Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: spawn ENOENT #277

Closed
badeend opened this issue Jun 26, 2013 · 30 comments
Closed

Error: spawn ENOENT #277

badeend opened this issue Jun 26, 2013 · 30 comments

Comments

@badeend
Copy link

badeend commented Jun 26, 2013

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>
@b0c1
Copy link

b0c1 commented Jul 4, 2013

Similar problem here, but Windows 8 and VS2012 installed. (sqlite3, ejdb, or any node-gyp library)

gyp info it worked if it ends with ok
gyp info using node-gyp@0.10.4
gyp info using node@0.10.12 | win32 | x64
gyp ERR! configure error
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.2.9200
gyp ERR! command "node" "C:\\Users\\jhaber\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure"
gyp ERR! cwd c:\Users\jhaber\AppData\Roaming\npm-cache\sqlite3\2.1.10\package
gyp ERR! node -v v0.10.12
gyp ERR! node-gyp -v v0.10.4
gyp ERR! not ok

@kumarsivam
Copy link

I too have the same error,please some one provide solution

@b0c1
Copy link

b0c1 commented Jul 6, 2013

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.

@scunish
Copy link

scunish commented Jul 10, 2013

i also have windows 7 64 bits, when i try to install pg module, i have the same error
Spawn ENOENT
error at errnoException (child_process.js:980:11)
error at Process.ChildProcess._handle.onexit (child_process.js:771:34)
System Windows_NT 6.1..7600
node -v v0.10.12
npm -v 1.2.32

aditional ----
node-gyp -v 0.10.5
Python 2.7.5 (64-bit)
Microsoft Visual Studio C++ 2010 (64-bit)
Windows 7 64-bit SDK
Microsoft Visual Studio C++ 2012 for Windows Desktop

@b0c1
Copy link

b0c1 commented Jul 10, 2013

scunish, start with nodejs 0.8 and you see the problem...

@scunish
Copy link

scunish commented Jul 10, 2013

hi b0c1 thank you for your response, what do you mean by start with node 0.8 im sorry i didnt undestood well,
do you mean install node version 0.8? and run from there?

i downgraded the version of node now the error is different,

1716 error ref@0.1.3 install: node-gyp rebuild
1716 error cmd "/c" "node-gyp rebuild" failed with 127
1717 error Failed at the ref@0.1.3 install script.
1717 error This is most likely a problem with the ref package,
1717 error not with npm itself.
1717 error Tell the author that this fails on your system:
1717 error node-gyp rebuild
1717 error You can get their info via:
1717 error npm owner ls ref
1717 error There is likely additional logging output above.
1718 error System Windows_NT 6.1.7600
1719 error command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "pg"
1720 error cwd C:\Users\Desarrollo\Documents\Node Code
1721 error node -v v0.8.22
1722 error npm -v 1.2.14
1723 error code ELIFECYCLE
1724 verbose exit [ 1, true ]

@b0c1
Copy link

b0c1 commented Jul 10, 2013

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 :)

@scunish
Copy link

scunish commented Jul 10, 2013

hi b0c1 thank you once more, my last comment was by using version 0.8.22 and threw that error, i switched to v 0.8.25 as u suggested and the new error is.

npm ERR! werid error 127
npm http 304 https://registry.npmjs.org/rmdir
npm ERR! not ok code 0

funny to read weird error

@b0c1
Copy link

b0c1 commented Jul 10, 2013

Ehh, funny, but maybe you can create an issue with the new data

@scunish
Copy link

scunish commented Jul 11, 2013

thank you b0c1 good luck.

@fredpantuzza
Copy link

I was getting the same problem. Solved defining the env variables:

PYTHONPATH=C:\Pyhon
PYTHON=%PYTHONPATH%\python.exe

Worked like charm

@badeend
Copy link
Author

badeend commented Jul 13, 2013

I tried setting the Python path, but that didn't work.

Downgrading to Node v0.8.25 worked!
The command node-gyp configure succeeded.
However node-gyp build failed. I was still able to compile the project manually by opening the solution in Visual Studio, though.

@xy-showen
Copy link

I have the same preoblem,I use node for v0.10.12,and use Visual Studio2012,the command node-gyp configure has the above problem,but i can compile the manually by opening the solution in Visual Studio too.

@hanssgo
Copy link

hanssgo commented Aug 14, 2013

having the same issue. node 0.10.15 npm 1.3.5

@daruj
Copy link

daruj commented Sep 20, 2013

Guys, to solve that issue I did not change the version of node, I just changed the version of python to this one: Python 2.7.5 Windows X86-64 Installer

Here is the page to download it: http://www.python.org/getit/

@Rialgar
Copy link

Rialgar commented Oct 9, 2013

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 :D

@xy-showen
Copy link

Thanks,this problem has been resolved.In fact,that moment I had set the environment PYTHON,but make a howler.

Thanks so much.
------------------ 原始邮件 ------------------
发件人: "Rialgar";notifications@github.com;
发送时间: 2013年10月9日(星期三) 上午10:54
收件人: "TooTallNate/node-gyp"node-gyp@noreply.github.com;
抄送: "肖永"568828193@qq.com;
主题: Re: [node-gyp] Error: spawn ENOENT (#277)

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

Make Sure Your Python and node are both x86 (32Bit) or both x86-x64 (64Bit), a mix will throw this error

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 :D


Reply to this email directly or view it on GitHub.

@dhkim8070
Copy link

I've solved this problem a moment ago.
I have struggled with this problem for 2 weeks. hum..

in windows 8

  1. I re-installed both of nodejs and python to 32-bit version.
  2. Remove environment variable PYTHON
    ex) set PYTHON=
  3. append python directory to PATH variable

Thank you all.

@nullivex
Copy link

Hey guys,

I wrote this gist after struggling with this all day yesterday and figured it might help someone.

https://gist.github.com/nullivex/7115612

I was able to get Canvas built a well as bson, bcrypt etc. I also wrapped together a lot of the information I found spread out beetween many docs.

Maybe this could be merged into the documenation for git.

Cheers hope this helps someone.

@JayBeavers
Copy link
Contributor

This started as an issue with Python being installed and on the path. Well known issue, though could use better error message when it occurs.

Closing this and tracking as #365.

@mavawie
Copy link

mavawie commented Jan 29, 2014

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: #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".

@niczak
Copy link

niczak commented Jan 30, 2014

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

@thany
Copy link

thany commented Mar 11, 2014

This issue is closed, but I don't see what the solution was?... The problem definately still exists.

@arobson
Copy link

arobson commented Apr 16, 2014

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

@sahilthadhani
Copy link

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.

@kristofferremback
Copy link

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

@debasishmohanty
Copy link

debasishmohanty commented Jun 7, 2016

For me this was solved by setting :

npm config set python C:\Python27\python.exe

@JsDevHub
Copy link

JsDevHub commented Nov 21, 2016

The solution is to update your system python then set it o NPM configuration

@thany
Copy link

thany commented Nov 25, 2016

@JsDevHub Can you please also explain how to do that then?

@Judjohn
Copy link

Judjohn commented Oct 20, 2017

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:

path

Hope that helps someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests