Error: spawn ENOENT
Node-gyp refuses to build any native modules I've tried. I'm on Windows 7 64 bit (I'm trying to compile for x86 though, as I don't have the x64 SDK installed). Node-gyp says it's a bug which I need to report, so here I am:
E:\project\node-ffi>node-gyp configure
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | ia32
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: spawn ENOENT
gyp ERR! stack at errnoException (child_process.js:980:11)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:771:
34)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Users\\Gebruiker\\AppData\\Roaming\\npm\\node_modul
es\\node-gyp\\bin\\node-gyp.js" "configure"
gyp ERR! cwd E:\project\node-ffi
gyp ERR! node -v v0.10.12
gyp ERR! node-gyp -v v0.10.2
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Please file an Issue:
gyp ERR! <https://github.com/TooTallNate/node-gyp/issues>
I would be careful by stating that this error occurs "only" with phyton not installed and not on the path. It cost me a couple of hours to discover (on W8.1, x64) that you need Python on your path as well as a separate ENV variable PYTHON=C:\Python\phyton.exe (or anything that matches the full path to your Python installation). However, with the latest versions of node and gyp as per now but when using an older (recommended?) version, namely 2.7.x of Python you may end up having to change the configure.js script:
- import platform; print (platform.python_version())
- import platform; print platform.python_version()
See the discussion over here: https://github.com/TooTallNate/node-gyp/issues/166 ...
Because the configure script does find Python but with the lines above the configure script cannot determine the version and hence you'll end up with the infamous "Error: spawn ENOENT".
No matter what combination of Python/Node I try I still can not get 'requestify' to install on my Windows machine.
This issue is closed, but I don't see what the solution was?... The problem definately still exists.
This problem was coming up for me on our TeamCity box (Windows 2012 x64); I couldn't get it to build any native extensions. Here's the list of things I did to resolve the problem that I pieced together from several different threads:
- Installed Python 2.7.6 x64 - download here
- Installed VS 2012 Express - download here
- Installed Windows 7 SDK - download here
- Set an environment variable PYTHON to 'c:\Python27\python.exe' - that's the default install location.
- I have to include a flag with every call to npm, '--msvs_version=2012'
Example TeamCity Command Line Task:
cd %teamcity.build.workingDir%
npm --msvs_version=2012 install
HTH
The below worked for me.
PYTHONPATH=C:\Pyhon PYTHON=%PYTHONPATH%\python.exe
I also had to add the python in path variable just like path = %PYTHON%
Also, the python version supported is between 2.5 and 3 only.
For me, this was solved by installing Python 2.7.10 (previously had Python 3.5.2 which was referenced by path as py and python).
I'm running Windows 10, Node v5.0.0
For me this was solved by setting :
npm config set python C:\Python27\python.exe
The solution is to update your system python then set it o NPM configuration
@JsDevHub Can you please also explain how to do that then?
In my case I was able to run the Gulp task in the Angular CLI, but was getting this issue in Visual Studio 2017. My solution was to change the order of my paths in Visual Studio. Tools > Options > Projects and Solutions > Web Package Management > External Web Tools
once there, re-order your paths such that $(PATH) is in the list right after your node modules as such:
Hope that helps someone.