node-gyp: 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 node-gyp@0.10.2
gyp info using node@0.10.12 | 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>

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Reactions: 19
  • Comments: 30 (1 by maintainers)

Most upvoted comments

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

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:

  1. Installed Python 2.7.6 x64 - download here
  2. Installed VS 2012 Express - download here
  3. Installed Windows 7 SDK - download here
  4. Set an environment variable PYTHON to ‘c:\Python27\python.exe’ - that’s the default install location.
  5. 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

No matter what combination of Python/Node I try I still can not get ‘requestify’ to install on my Windows machine.

Ok, from reading your discussion and my own expirements I can conduct the following solution:

  1. Make Sure Your Python and node are both x86 (32Bit) or both x86-x64 (64Bit), a mix will throw this error
  2. set the environment variable PYTHON to your python.exe, in my case I ran “set PYTHON=E:\Python27\python.exe” bevore running npm

works like a charm 😄

Nope. I mean install nodejs 0.8 😃 You using: “node -v v0.10.12” 😃 What I do:

  • I copied the whole directory to another name
  • download the 0.8 version from http://nodejs.org/dist/v0.8.25/ (node.exe, node.exp, node.lib, node.pdb) and put it to the original directory (replaced the files)
  • run your code again 😃

Hi! start the build with nodejs 0.8 - this will provide much more information about the error…

In my machine (I installed python manually later and I set PYTHON environment variable and python binary to the path) I removed the PYTHON variable from environment properties (set PYTHON=) and it’s work correctly.