node-gyp rebuild fails in VS2015 due to wrong path
See original GitHub issuePackage restore in Visual Studio 2015 fails with the following:
> bufferutil@1.2.1 install C:\MyProject\node_modules\bufferutil
> node-gyp rebuild
C:\MyProject\node_modules\bufferutil>node "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.DNX.Publishing.targets(156,5): Error : module.js:340
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.DNX.Publishing.targets(156,5): Error : throw err;
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.DNX.Publishing.targets(156,5): Error : ^
DNU(0,0): Error : Cannot find module 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js'
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.DNX.Publishing.targets(156,5): Error : at Function.Module._resolveFilename (module.js:338:15)
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.DNX.Publishing.targets(156,5): Error : at Function.Module._load (module.js:280:25)
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.DNX.Publishing.targets(156,5): Error : at Function.Module.runMain (module.js:497:10)
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.DNX.Publishing.targets(156,5): Error : at startup (node.js:119:16)
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.DNX.Publishing.targets(156,5): Error : at node.js:906:3
npm ERR! bufferutil@1.2.1 install: `node-gyp rebuild`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the bufferutil@1.2.1 install script.
npm ERR! This is most likely a problem with the bufferutil package,
npm ERR! not with npm itself.
Looks like the file path to node-gyp.js
is wrong - I believe it should be:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\npm\node_modules\node-gyp\bin\node-gyp.js
This may be a result of installing the lates Node.js Tools for Visual Studio (I’m not sure this is the cause though) https://www.visualstudio.com/en-us/features/node-js-vs.aspx
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
NPM install fails with node-gyp
At first it complained that it needed python, so we installed that. Then it complained that it needed VCBuild, which we installed (using...
Read more >A Comprehensive Guide to Fixing Node-Gyp Issues on Windows
1. Try running npm install with the --no-optional flag. · 2. Try downloading the windows-build-tools package. · 3. Download the Visual Studio 2015...
Read more >Troubleshooting node-gyp Package on Windows 11
Long Path Issue ... It's not related to the node-gyp package, but you will frequently see this issue while developing the node.js app...
Read more >Issue with npm install - M220JS
When I try npm install, it initially creates node_modules folder, but after few seconds, it throws an error npm ERR! code 1 npm...
Read more >Please solve it! - Report bugs
npm ERR! code 1 npm ERR! path C:\Users\User\AppData\Roaming\npm\node_modules\ ... npm ERR! gyp ERR! find VS looking for Visual Studio 2015
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I solved the problem by updating my enviroment to node@6.10.3 and npm@3.10.10 The problem happend with node-gym@3.3.1
I’ll close, not a node-gyp issue.