Can not install node-gyp - node.js

I can't install node-gyp in Windows 7. After many searches and trying many suggestions, I use (+), use npm install no-gyp-xml-stream. and in cmd (run as admin) this errors occurred:
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Enter
prise\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:248:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Program Files\nodejs\node_modules\local-npm\node_modules\leveldo
wn
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! leveldown#1.7.2 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the leveldown#1.7.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\h.mohammdi\AppData\Roaming\npm-cache\_logs\2019-05-07T06_2
8_59_501Z-debug.log
I check to sure C:\Program Files (x86)\Microsoft Visual Studio\2017\Enter
prise\MSBuild\15.0\Bin\MSBuild.exe is existed.
How can I install node-gyp to install local-npm? thanks...

From node-gyp documentation:
First install Microsoft's windows-build-tools using npm install --global --production windows-build-tools from PowerShell or CMD.exe (run as Administrator)
Install it globally using npm install -g node-gyp

You could use Node 11, not yet Node 12 as node-gyp will fail with v12

Related

NPM can't install some packages

I have recently done a clean reformatting of my Windows PC, installed Atom, and Node.js and started by installing the package dualshock. I give it a minute and it fails with this error code:
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:210:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
gyp ERR! System Windows_NT 10.0.18363
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:\Users\Starb\node_modules\node-hid
gyp ERR! node -v v13.2.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN starb#1.0.0 No description
npm WARN starb#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-hid#0.5.7 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-hid#0.5.7 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\Starb\AppData\Roaming\npm-cache\_logs\2019-11-29T13_46_21_869Z-debug.log
I tried reinstalling gyp, Node, cleaning the cache, anything you can possibly imagine. i googled everywhere and couldnt find any solution that worked.
Full log from the console
If you use windows you are probably missing windows-build-tools
npm install --global --production windows-build-tools
Reference: https://github.com/nodejs/node-gyp

Issue installing jhipster-uml

Using windows 10 when I run the command npm install -g jhipster-uml I have the following error:
C:\Users\Talon\AppData\Roaming\npm\jhipster-uml -> C:\Users\Talon\AppData\Roaming\npm\node_modules\jhipster-uml\jhipster-uml.js
> deasync#0.1.9 install C:\Users\Talon\AppData\Roaming\npm\node_modules\jhipster-uml\node_modules\deasync
> node ./build.js
C:\Users\Talon\AppData\Roaming\npm\node_modules\jhipster-uml\node_modules\deasync>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 "python", 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:152:21)
gyp ERR! System Windows_NT 10.0.15063
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:\Users\Talon\AppData\Roaming\npm\node_modules\jhipster-uml\node_modules\deasync
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! deasync#0.1.9 install: `node ./build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the deasync#0.1.9 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\Talon\AppData\Roaming\npm-cache\_logs\2018-01-11T14_51_34_388Z-debug.log
Googling around it seems to be a Windows issue with npm_config_node_gyp. I tried using npm cli to install other packages and it works, so it's most likely an issue with jhipster-uml.
I also tried using yarn to install it, I have a really similar error.
Can't find Python executable "python", you can set the PYTHON env variable.
You have to install python and restart the bash
If python is already installed, check if it's available in your PATH. If no, just add it.

npm install lead to gyp ERR! build error (node-java)

i have project with nodejs & java code , the project working fine on MAC but
when trying to install project on Windows7 64 bit i get the following error :
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` fail
ed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:269:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074
:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\HDaghash\Documents\QosAdministration\node_modules\java
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! java#0.6.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the java#0.6.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the java package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls java
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\HDaghash\Documents\QosAdministration\npm-debug.log
i tried to install visual studio 2012 instead of 2013 as i read in some tickets on github but the same issue still exist.
any one can help with this issue ?
Thanks in advance .
It has a dependency on node-gyp node module and node-gyp does not install in windows.
Here is the solution ...
Java Setup
npm install -g node-gyp
Run
in administrator privileged command prompt window
npm install --global --production windows-build-tools
npm update
npm install java

Unable to install node ZeroMQ through npm in windows

We are trying to install zeromq through npm on windows8 64 bit
*we install visual studio 2010 and python
but still we are getting the error as follows:
D:\Projects\changi\node_modules\zmq>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-g
yp.js" rebuild ) else (rebuild)
gyp ERR! configure error
gyp ERR! stack Error: spawn C:\Python27 ENOENT
gyp ERR! stack at exports._errnoException (util.js:849:11)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
gyp ERR! stack at onErrorNT (internal/child_process.js:344:16)
gyp ERR! stack at doNTCallback2 (node.js:430:9)
gyp ERR! stack at process._tickCallback (node.js:344:17)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\Projects\changi\node_modules\zmq
gyp ERR! node -v v4.1.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "zmq"
npm ERR! node v4.1.2
npm ERR! npm v2.7.4
npm ERR! code ELIFECYCLE
npm ERR! zmq#2.14.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the zmq#2.14.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the zmq package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls zmq
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\Projects\changi\npm-debug.log
Could you please tell us what we are missing or point us to some document which will help us to do this thanks for ur time
Set PYTHON Enviorment Variable.
* Install python. Make sure Python 2.7.x with the steps provided below
http://www.howtogeek.com/197947/how-to-install-python-on-windows/
And confirm by running below commands:
$ python -V
Python 2.7.9
*installed node-gyp manually:
$ npm install -g node-gyp
*installed 'Visual Studio 2012 Express for Windows Desktop'
*install 'Windows7 SDK'
*And do npm install zmq
and it worked!

Trouble with node bcrypt installation

I am learning sails.js. So I just want to encrypt password using node module bcrypt.
npm install bcrypt is the command what I use to install bcrypt modules, I came to know that it has many dependencies, I intalled node-gyp as well npm install -g node-gyp
Can anyone suggest how can I get it resolved?
Error :
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
blowfish.cc
bcrypt.cc
bcrypt_node.cc
C:\Program Files\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning
C4530: C++ exception handler used, but unwind semantics are not enabled. Specif
y /EHsc [c:\Users\Aditya Sethi\Documents\backup\My-Twitter\node_modules\bcrypt\
build\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(38): fatal error C1083: Cannot open include file: 'openss
l/rand.h': No such file or directory [c:\Users\Aditya Sethi\Documents\backup\My
-Twitter\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (c:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:
12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "c:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd c:\Users\Aditya Sethi\Documents\backup\My-Twitter\node_modules\bcry
pt
gyp ERR! node -v v0.10.22
gyp ERR! node-gyp -v v0.11.0
gyp ERR! not ok
npm ERR! bcrypt#0.7.7 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt#0.7.7 install script.
npm ERR! This is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodej
s\\node_modules\\npm\\bin\\npm-cli.js" "install" "bcrypt" "--save"
npm ERR! cwd c:\Users\Aditya Sethi\Documents\backup\My-Twitter
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! c:\Users\Aditya Sethi\Documents\backup\My-Twitter\npm-debug.log
npm ERR! not ok code 0
I had pretty much the same problem on Ubuntu 13.10, the error log looked the same and the bcrypt installation stopped at node-gyp rebuild. After some searching and updating node and npm I still had the same issues.
I found a solution finally here: https://github.com/ncb000gt/node.bcrypt.js/issues/90 and the problem was the ~/.node-gyp directory which had unsufficient access rights and simply deleting it did the trick. This is where gyp stores headers and other build files during compilation and if it's gone, gyp will just recreate it.
Try to install global windows build tool if you are using windows,
follow this link bcrypt install instruction
npm install --global --production windows-build-tools

Resources