node-gyp: NPM fails on msbuild.exe with exit code 1
The printout from cmd:
C:\Users\Gilbert>cd webstormprojects/nodeofgames
C:\Users\Gilbert\WebstormProjects\NodeOfGames>npm install bcrypt --save
npm http GET https://registry.npmjs.org/bcrypt
npm http 304 https://registry.npmjs.org/bcrypt
npm http GET https://registry.npmjs.org/bindings/1.0.0
npm http 304 https://registry.npmjs.org/bindings/1.0.0
> bcrypt@0.7.1 install C:\Users\Gilbert\WebstormProjects\NodeOfGames\node_module
s\bcrypt
> node-gyp rebuild
C:\Users\Gilbert\WebstormProjects\NodeOfGames\node_modules\bcrypt>node "C:\Progr
am Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node
-gyp\bin\node-gyp.js" rebuild
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(29
7,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.
TargetFrameworkVersion or PlatformToolset may be set to an invalid version nu
mber. [C:\Users\Gilbert\WebstormProjects\NodeOfGames\node_modules\bcrypt\build\
bcrypt_lib.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp
.Win32.Targets(147,5): error MSB6006: "CL.exe" exited with code -1073741515. [C
:\Users\Gilbert\WebstormProjects\NodeOfGames\node_modules\bcrypt\build\bcrypt_l
ib.vcxproj]
gyp ERR! rebuild error Error: `C:\windows\Microsoft.NET\Framework\v4.0.30319\msb
uild.exe` failed with exit code: 1
gyp ERR! rebuild error at ChildProcess.onExit (C:\Program Files (x86)\nodejs
\node_modules\npm\node_modules\node-gyp\lib\build.js:214:23)
gyp ERR! rebuild error at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! rebuild error at Process._handle.onexit (child_process.js:674:10)
gyp ERR! not ok
npm ERR! bcrypt@0.7.1 install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the bcrypt@0.7.1 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 (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "bcrypt" "--save"
npm ERR! cwd C:\Users\Gilbert\WebstormProjects\NodeOfGames
npm ERR! node -v v0.8.1
npm ERR! npm -v 1.1.33
npm ERR! code ELIFECYCLE
npm ERR! message bcrypt@0.7.1 install: `node-gyp rebuild`
npm ERR! message `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\Gilbert\WebstormProjects\NodeOfGames\npm-debug.log
npm ERR! not ok code 0
C:\Users\Gilbert\WebstormProjects\NodeOfGames>
About this issue
- Original URL
- State: closed
- Created 12 years ago
- Comments: 48 (12 by maintainers)
Commits related to this issue
- chore: release 0.9.5 (#119) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> — committed to targos/node-gyp by github-actions[bot] 3 years ago
Honestly I don’t know, you’re gonna have to figure that out.
I also faced same Error on MSBuild.exe with Window 7 and window 10 64bit machine. I had tried number of attempt with installation of windows-build-tools global but got repeated failure. But when i install windows-build-tools local folder, i got the success. ( npm install --production windows-build-tools )
I’m sorry, this is a bcrypt issue at this point. You’ll need to open an issue over at that repo.
Ok so try updating node-gyp. From that same directory:
I am with a Windows 10 (64 bit) computer and I have experienced the very same issue. I managed to get it solved and here are my key steps taken:
Hope this can help you solve your problem. 😄
Oh, sorry, you need to do that from a Command Prompt with Administrator privileges. Right click on cmd and do “run as administrator” and try again.
oh boy, nevermind: updating Everything™ to the latest version worked out well shame. Thanks anyway and have a nice weekend! TGIF yay.
The real problem of this issue is variable setup , the “VCTargetsPath” 's variable was difference between window server and window 10.
If you used window 10, it need to set “VCTargetsPath” with set VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140
If you used widows server above command, it will give you some error then you need to set this variable via window system tool: System Properties>Environment Variables>System variables>New
Then you need to set variable to VCTargetsPath and value is C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140
Hi, I am facing issue in **npm install bufferutil _. It’s giving the error _msbuild failed with exit code 1 I have done all the things mentioned by @mousetraps for node gyp issue. I have latest version of node (v6. 3. 1), npm(v3. 10. 3), node gyp(v3. 3. 1) installed on my windows 7 machine.
Done following steps for node gyp issue.
1.Install VC++ Build Tools Technical Preview, choose Custom Install, and select both Windows 8.1 and Windows 10 SDKs.
2.Install Python 2.7, and add it to your PATH
3.npm config set python python2.7 --global
4.npm config set python C:\Python27\python.exe --global
5.npm config set msvs_version 2015 --global
6.set VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140
Errors: msbuild error.txt
Please help
Caused by
node-sass
generally. So you should do this in your project directory.First,
Then,
If you are using node v13 or later it may not work due to node-sass being buggy.
Try using nvm and change to an earlier version of node. I tried with node v10 and it worked fine.
getting error like : 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:262:23) gyp ERR! stack at ChildProcess.emit (events.js:182:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12) gyp ERR! System Windows_NT 10.0.17763 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:\appLatest\appLatest\node_modules\voicemeeter\node_modules\ffi gyp ERR! node -v v10.15.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-linux@1.2.0 (node_modules\7zip-bin-linux): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 7zip-bin-linux@1.2.0: wanted {“os”:“linux”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! ffi@2.2.0 install:
node-gyp rebuild
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the ffi@2.2.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\alliancetek\AppData\Roaming\npm-cache_logs\2019-02-05T10_55_54_298Z-debug.log
Thanks ganesh buddy, you have save my day,. i have spent for almost 2days,
Finally its working now man, thanks.
Below i have posted my error and issue 👍
ganeshkatore comment
when someone (like me) use Discord.js v12, Node.js v13+ is required
i’ve installed Openssl but there’s no change, the lines:
c:\users\gilbert.node-gyp\0.8.1\deps\openssl\openssl\include\openssl…/…/e_os2.h(56): fatal error C1083: Cannot open include file: ‘openssl/opensslconf.h’: No such file or directory [c:\Users\Gilbert\WebstormProjects\NodeOfGames\node_ modules\bcrypt\build\bcrypt_lib.vcxproj]
are red
Nathan Rajlich wrote:
Check that your VS actually has C++ installed (just an option in Community editions) try https://www.visualstudio.com/downloads/ near the bottom of the page for the installer to be on the safe side.