NPM can't install some packages - node.js

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

Related

How to fix Node-gyp MSBuild.exe` failed with exit code: 1

I'm trying to install (npm i recommender) module but i came across several erros, regarding pyhon version an so on, the one i haven't got a solution for is Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1
I tried removing and installing node-gyp module and applying also several solutions found on the internet(i have vs community 2017 with c++ installed), and used npm install --msvs_version=2017.
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\IANNIS\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:190:23)
gyp ERR! stack at ChildProcess.emit (events.js:203:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Users\\IANNIS\\Desktop\\project_app\\server\\node_modules\\node\\bin\\node.exe" "C:\\Users\\IANNIS\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\IANNIS\Desktop\project_app\server\node_modules\recommender
gyp ERR! node -v v12.6.0
gyp ERR! node-gyp -v v5.0.2
gyp ERR! not ok
npm WARN api_food_finder#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! recommender#3.0.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the recommender#3.0.0 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\IANNIS\AppData\Roaming\npm-cache\_logs\2019-07-15T21_15_43_134Z-debug.log
C:\Users\IANNIS\Desktop\project_app\server>

Can not install node-gyp

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

npm install bcrypt failed

I tried to install bcrypt to my Node JS project, but it went wrong.
I am using NodeJS version 4.5.0 and npm 3.10.7.
My operating system is Windows 10 anniversary 64 bit.
Here is error in CMD:
C:\Users\kim\Documents\college\Skripsi\jti-test\node_modules\bcrypt>if not defined npm_config_node_gyp (node "C:\Users\kim\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the
file specified. [C:\Users\kim\Documents\college\Skripsi\jti-test\node_mo
dules\bcrypt\build\bcrypt_lib.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\kim\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\kim\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\kim\Documents\college\Skripsi\jti-test\node_modules\bcrypt
gyp ERR! node -v v4.5.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\kim\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "bcrypt" "--save"
npm ERR! node v4.5.0
npm ERR! npm v3.10.7
npm ERR! code ELIFECYCLE
npm ERR! bcrypt#0.8.7 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt#0.8.7 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, 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 information on how to open an issue for this project with:
npm ERR! npm bugs bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\kim\Documents\college\Skripsi\jti-test\npm-debug.log
This is the full log file: link

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

Node-gyp 0.12.0 not found

When I attempt to install memwatch from npm with npm install memwatch I receive these errors before it fails completely:
gyp WARN EACCES user does not have permission to access the dev dir "~/.node-gyp/0.12.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/var/folders/bf/_rxhpvq936b1vxf9ylygj86r0000gn/T/.node-gyp"
and
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/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:1067:12)
gyp ERR! System Darwin 14.3.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/cmlewis95/Dropbox/Programming/Projects/Markdown/node_modules/memwatch
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "memwatch"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! memwatch#0.2.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the memwatch#0.2.2 install script 'node-gyp rebuild'.
When I go to the location which it says it doesn't have access to, the version number listed in the error is not a directory. I only have a 0.10.13 folder there. I assumed I just needed to update node-gyp but all of the documentation I found on that did not solve the issue. Thanks.
If you happened to use Window, make it sure your opening commanding prompt as administrators access. By most chances if you using either Linux or OSX, try add a prefix sudo in front of your command,
sudo npm install memwatch

Resources