1

This is the error I get when I try to install the package:

C:\WINDOWS\system32\node_modules\lame>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Program", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:158:21)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\WINDOWS\system32\node_modules\lame
gyp ERR! node -v v10.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lame@1.2.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lame@1.2.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Home\AppData\Roaming\npm-cache\_logs\2018-07-08T23_48_21_208Z-debug.log

All other packages including node-gyp install fine. Ive found a few threads with people that have had similar problems, but none of their solutions have worked. As per the suggestion of this answer I tried these things:

UPDATED 09/2016
If you're using Windows you can now install all node-gyp dependencies with single command (NOTE: Run As Admin in Windows PowerShell):

 $ npm install --global --production windows-build-tools
and then install the package

 $ npm install --global node-gyp
UPDATED 06/2018
https://github.com/nodejs/node-gyp/issues/809#issuecomment-155019383

Delete your $HOME/.node-gyp directory and try again.

See full documentation here: node-gyp

They had to effect. Thank you for your time!

Alex Taylor
  • 8,343
  • 4
  • 25
  • 40
pogona
  • 113
  • 4
  • Do you have Python installed? That's the problem I'm seeing. – ThisClark Jul 09 '18 at 00:12
  • `$ npm install --global --production windows-build-tools` Installed Python. Should I try installing it myself? If so, how do I set the `PYTHON` environment variable it mentions? – pogona Jul 09 '18 at 00:16
  • First, you'd have to find out where it was installed, then follow these steps to add it to path variable: https://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows You can test it worked by typing `python` in a command prompt and getting a version number from there. – ThisClark Jul 09 '18 at 00:17

1 Answers1

2

Do you have python installed?

This is your error: Error: Can't find Python executable "C:\Program", you can set the PYTHON env variable.

You can also put your python in a path without space to solve your problem until the but has been fixed

See this and this issue on github

Marlom
  • 578
  • 5
  • 15
  • `$ npm install --global --production windows-build-tools` Installed Python. Should I try installing it myself? If so, how do I set the `PYTHON` environment variable it mentions? – pogona Jul 09 '18 at 00:15
  • 1
    The problem isn't that python isn't installed, it's that something that is calling it hasn't quoted the path correctly (`"C:\Program"` is almost certainly `C:\Program Files`). That said, I'm not sure where to fix this. It seems like a bug on the relevant module to me. – Timothy Jones Jul 09 '18 at 00:18
  • [Try it](https://superuser.com/a/143121). It should solve your problem. – Marlom Jul 09 '18 at 00:18
  • After reinstalling Python, fiddling with the environment variables, and reinstalling node-gyp, it worked. Thank you all for your help. – pogona Jul 09 '18 at 02:20
  • I got this error even with Python correctly installed exactly at the location reported in the error message. What got me out of trouble was reinstalling node-gyp globally: `$ npm install -g node-gyp` – jfroy Jul 18 '18 at 20:39