node stopped working - impossible to install any npm packages

Created on 29 Mar 2016  Â·  9Comments  Â·  Source: nodejs/node

  • Version: v.5.9.1
  • Platform: Windows 10 (it does not work in Windows 7 either), 64-bit
  • Subsystem: any - express, mosca, ...
    during:
    > npm install mosca --save
    but also any other - express for example
    It started last couple of days. It worked fine a week ago
npm WARN prefer global [email protected] should be installed with -g

> [email protected] install C:\Dani-R&D\JS\mqtt\node_modules\kerberos
> (node-gyp rebuild) || (exit 0)


C:\Dani-R&D\JS\mqtt\node_modules\kerberos>if not defined npm_config_node_gyp (node "C:\Dani-R&D\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Python executable "C:\Python33\python.EXE" is v3.3.3, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at failPythonVersion (C:\Dani-R&D\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:406:14)
gyp ERR! stack     at C:\Dani-R&D\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:395:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:193:7)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:850:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Dani-R&D\\nodejs\\node.exe" "C:\\Dani-R&D\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Dani-R&D\JS\mqtt\node_modules\kerberos
gyp ERR! node -v v5.9.1
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok

> [email protected] install C:\Dani-R&D\JS\mqtt\node_modules\hiredis
> node-gyp rebuild


C:\Dani-R&D\JS\mqtt\node_modules\hiredis>if not defined npm_config_node_gyp (node "C:\Dani-R&D\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Python executable "C:\Python33\python.EXE" is v3.3.3, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at failPythonVersion (C:\Dani-R&D\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:406:14)
gyp ERR! stack     at C:\Dani-R&D\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:395:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:193:7)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:850:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Dani-R&D\\nodejs\\node.exe" "C:\\Dani-R&D\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Dani-R&D\JS\mqtt\node_modules\hiredis
gyp ERR! node -v v5.9.1
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1

> [email protected] install C:\Dani-R&D\JS\mqtt\node_modules\fs-ext
> node-gyp configure build


C:\Dani-R&D\JS\mqtt\node_modules\fs-ext>if not defined npm_config_node_gyp (node "C:\Dani-R&D\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure build )  else (node "" configure build )
gyp ERR! configure error
gyp ERR! stack Error: Python executable "C:\Python33\python.EXE" is v3.3.3, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at failPythonVersion (C:\Dani-R&D\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:406:14)
gyp ERR! stack     at C:\Dani-R&D\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:395:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:193:7)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:850:16)
gyp ERR! stack     at Socket.<anonymous> (internal/child_process.js:323:11)
gyp ERR! stack     at emitOne (events.js:90:13)
gyp ERR! stack     at Socket.emit (events.js:182:7)
gyp ERR! stack     at Pipe._onclose (net.js:477:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Dani-R&D\\nodejs\\node.exe" "C:\\Dani-R&D\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "build"
gyp ERR! cwd C:\Dani-R&D\JS\mqtt\node_modules\fs-ext
gyp ERR! node -v v5.9.1
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp configure build`
npm WARN install:[email protected] Exit status 1

> [email protected] install C:\Dani-R&D\JS\mqtt\node_modules\dtrace-provider
> node scripts/install.js


> [email protected] install C:\Dani-R&D\JS\mqtt\node_modules\bufferutil
> node-gyp rebuild


C:\Dani-R&D\JS\mqtt\node_modules\bufferutil>if not defined npm_config_node_gyp (node "C:\Dani-R&D\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Python executable "C:\Python33\python.EXE" is v3.3.3, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at failPythonVersion (C:\Dani-R&D\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:406:14)
gyp ERR! stack     at C:\Dani-R&D\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:395:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:193:7)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:850:16)
gyp ERR! stack     at Socket.<anonymous> (internal/child_process.js:323:11)
gyp ERR! stack     at emitOne (events.js:90:13)
gyp ERR! stack     at Socket.emit (events.js:182:7)
gyp ERR! stack     at Pipe._onclose (net.js:477:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Dani-R&D\\nodejs\\node.exe" "C:\\Dani-R&D\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Dani-R&D\JS\mqtt\node_modules\bufferutil
gyp ERR! node -v v5.9.1
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1

> [email protected] install C:\Dani-R&D\JS\mqtt\node_modules\utf-8-validate
> node-gyp rebuild


C:\Dani-R&D\JS\mqtt\node_modules\utf-8-validate>if not defined npm_config_node_gyp (node "C:\Dani-R&D\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Python executable "C:\Python33\python.EXE" is v3.3.3, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at failPythonVersion (C:\Dani-R&D\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:406:14)
gyp ERR! stack     at C:\Dani-R&D\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:395:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:193:7)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:850:16)
gyp ERR! stack     at Socket.<anonymous> (internal/child_process.js:323:11)
gyp ERR! stack     at emitOne (events.js:90:13)
gyp ERR! stack     at Socket.emit (events.js:182:7)
gyp ERR! stack     at Pipe._onclose (net.js:477:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Dani-R&D\\nodejs\\node.exe" "C:\\Dani-R&D\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Dani-R&D\JS\mqtt\node_modules\utf-8-validate
gyp ERR! node -v v5.9.1
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1

> [email protected] install C:\Dani-R&D\JS\mqtt\node_modules\leveldown
> prebuild --install


> [email protected] install C:\Dani-R&D\JS\mqtt\node_modules\zmq
> node-gyp rebuild


C:\Dani-R&D\JS\mqtt\node_modules\zmq>if not defined npm_config_node_gyp (node "C:\Dani-R&D\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Python executable "C:\Python33\python.EXE" is v3.3.3, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at failPythonVersion (C:\Dani-R&D\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:406:14)
gyp ERR! stack     at C:\Dani-R&D\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:395:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:193:7)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:850:16)
gyp ERR! stack     at Socket.<anonymous> (internal/child_process.js:323:11)
gyp ERR! stack     at emitOne (events.js:90:13)
gyp ERR! stack     at Socket.emit (events.js:182:7)
gyp ERR! stack     at Pipe._onclose (net.js:477:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Dani-R&D\\nodejs\\node.exe" "C:\\Dani-R&D\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Dani-R&D\JS\mqtt\node_modules\zmq
gyp ERR! node -v v5.9.1
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1
npm question

Most helpful comment

gyp requires python 2. From your log, it looks like you have python 3 installed.

All 9 comments

mosca fails to install similar way after downgrading to node 4.4.1 (LTS) as well, Express is back and working

gyp requires python 2. From your log, it looks like you have python 3 installed.

Why should I have separate Python install for using nodejs? I may not need
it at all. If nodejs requires any tools it should have them inside the
install package - it was this way till few days ago. So why are there
changes that break a lot? Why do I need know to make special additional
installations of outdated software? It's unacceptable!

_BR_
_Dani Zilberstein_
_home: +972-(0)9-7495890_
_mob: +972-(0)50-8503456_
_e-mail: [email protected] [email protected]_

On Tue, Mar 29, 2016 at 4:04 PM, Evan Lucas [email protected]
wrote:

gyp requires python 2. From your log, it looks like you have python 3
installed.

—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/nodejs/node/issues/5946#issuecomment-202882128

Native modules require python 2 to build because gyp is used to build them. Gyp has a hard dependency on python 2. You can use node without having python 2, you just won't be able to use native modules.

there were no any problem with it a week ago. What changed?

On Tue, Mar 29, 2016 at 6:20 PM, Evan Lucas [email protected]
wrote:

Native modules require python 2 to build because gyp is used to build
them. Gyp has a hard dependency on python 2. You can use node without
having python 2, you just won't be able to use native modules.

—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/nodejs/node/issues/5946#issuecomment-202949329

and another point - if node-gyp requires python 2 it must include it in its
install package. anyway node-gyp is a part of nodejs install (at least it
is told there)
anyway - it did not require it a week ago.
furthermore - if I install python 2 there are new problems coming up -
windows SDK and more...
all this was not required a week ago.

On Tue, Mar 29, 2016 at 6:24 PM, Dan Zilberstein [email protected] wrote:

there were no any problem with it a week ago. What changed?

On Tue, Mar 29, 2016 at 6:20 PM, Evan Lucas [email protected]
wrote:

Native modules require python 2 to build because gyp is used to build
them. Gyp has a hard dependency on python 2. You can use node without
having python 2, you just won't be able to use native modules.

—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/nodejs/node/issues/5946#issuecomment-202949329

python2 has been a hard dependency of node-gyp (due to it being a dependency of gyp) for quite some time now. I am not sure why this problem is just now presenting itself on your system though. In order to not mess up your python 3 install, you could install python 2 along side of it (just don't add it to your path). Then you can force npm to always use python 2 by doing the following:

$ npm config set python C:\<path to python.exe>

I do not know about the history of node-gyp dependecies and I do not argue about it.
However the facts are as following: two weeks ago I installed "npm install mosca --save" in my computer without any problems. But the last week it began failing like above. Point. And my students complained that the same problem started in their computers with "npm install express --save" as well. So my conclusion was that the problem had been introduced by nodejs itself.

However the facts are as following: two weeks ago I installed "npm install mosca --save" in my computer without any problems.

Sounds like mosca took on a dependency (direct or indirect) on a module with a native component (i.e., one that needs node-gyp and a compiler.) Try installing the exact same version you installed last time and see if the problem goes away.

I'm going to close the issue because I have no reason to believe it's in any way related to node core.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jmichae3 picture jmichae3  Â·  3Comments

willnwhite picture willnwhite  Â·  3Comments

mcollina picture mcollina  Â·  3Comments

Icemic picture Icemic  Â·  3Comments

vsemozhetbyt picture vsemozhetbyt  Â·  3Comments