In my case, this led to the error below:
C:\Users\user\DemoApp2\node_modules\bufferutil>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild ) gyp ERR! build error gyp ERR! stack Error: Can't find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed? gyp ERR! stack at findMsbuild (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:128:23) gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:110:11 gyp ERR! stack at F (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:69:16) gyp ERR! stack at E (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:81:29) gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:90:16 gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\index.js:44:5 gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\windows.js:29:5 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15) gyp ERR! System Windows_NT 10.0.10240 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\user\DemoApp2\node_modules\bufferutil gyp ERR! node -v v6.3.1 gyp ERR! node-gyp -v v3.3.1 gyp ERR! not ok npm WARN install: bufferutil@1.2.1 bufferutil@1.2.1 install: `node-gyp rebuild` npm WARN install: bufferutil@1.2.1 Exit status 1 utf-8-validate@1.2.1 install C:\Users\user\DemoApp2\node_modules\utf-8-validate node-gyp rebuild
So, I followed these steps to fix the problem:
- First download and install Microsoft Build Tools 2013 from:
http://www.microsoft.com/en-us/download/details.aspx?id=40760 and run npm config set msvs_version 2013 --global , as suggested by catalint. - Delete the
.npm-gyp under C:\Users\user - run
npm install -g fs --save-dev - Copy the downloaded fs folder from
C:\Users\user\AppData\Roaming\npm\node_modules to $nodehome\node_modules\npm\node_modules (Note: in my case it is C:\Program Files\nodejs\node_modules\npm\node_modules ) - run
npm install --msvs_version=2013 node-gyp rebuild
After completing the above steps, I stopped getting build errors.
decay source share