trying to 'npm install', getting node-gyp rebuild errors
ernestscomputer:musicomp ernest son$ npm install
> [email protected] install /Users/ernest son/Desktop/PROJECTS/musicomp/node_modules/bufferutil
> node-gyp rebuild
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
clang: error: no such file or directory: 'son/.node-gyp/5.0.0/include/node'
clang: error: no such file or directory: 'son/.node-gyp/5.0.0/src'
clang: error: no such file or directory: 'son/.node-gyp/5.0.0/deps/uv/include'
clang: error: no such file or directory: 'son/.node-gyp/5.0.0/deps/v8/include'
make: *** [Release/obj.target/bufferutil/src/bufferutil.o] Error 1
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:270: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 Darwin 14.5.0
gyp ERR! command "/usr/local/Cellar/node/5.0.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/ernest son/Desktop/PROJECTS/musicomp/node_modules/bufferutil
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1
> [email protected] install /Users/ernest son/Desktop/PROJECTS/musicomp/node_modules/utf-8-validate
> node-gyp rebuild
CXX(target) Release/obj.target/validation/src/validation.o
clang: error: no such file or directory: 'son/.node-gyp/5.0.0/include/node'
clang: error: no such file or directory: 'son/.node-gyp/5.0.0/src'
clang: error: no such file or directory: 'son/.node-gyp/5.0.0/deps/uv/include'
clang: error: no such file or directory: 'son/.node-gyp/5.0.0/deps/v8/include'
make: *** [Release/obj.target/validation/src/validation.o] Error 1
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:270: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 Darwin 14.5.0
gyp ERR! command "/usr/local/Cellar/node/5.0.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/ernest son/Desktop/PROJECTS/musicomp/node_modules/utf-8-validate
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1
I had similar issues on Ubuntu 14.04, after trying everything here I finally solved it by running:
sudo apt-get install build-essential
As is recommended here: https://nodejs.org/en/download/package-manager/
I already had build-essential installed, installing libkrb5-dev did the trick for me:
apt-get install libkrb5-dev
For me, just deleting the ~/.node-gyp folder, then running npm update on my project solved the problem (without rebooting). Thank for the trick!
Run into same error when trying to download dependencies for angular-phonecat . I solved it by using @bnoordhuis method just the same way @JxnGraphix put it.
Node 4.2.3
I also deleted the node_modules directory I had (including .node-gyp and all), solved my issue. No restart.
Thanks @aroc I removed ~/.node-gyp and ~/.npmrc. In my project I removed node_modules and restarted my machine (restart might not be necessary) and all worked great.
node v4.1.2 npm 2.14.4 OS X El Capitan
Thanks @JxnGraphix - your solution worked for me
Node v5.7.0
for me helped: apt-get install libkrb5-dev
thanks @samgranger
Had a problem with this rebuilding node-sass, deleting ~/.node-gyp and npm update did it for me.
Closing, looks like this issue ran its course.
Running node 6.2.0 here and getting getting node-gyp error. Anyone had this issue with this version of node.js ?
@novarac23 I'm getting it with node 6.1.0
Same here, node v6.2.1
Here as well, node v6.2.1
Yes same here also... node v6.2.1 with Windows OS
To solve this I downgraded node to v5.12.0, removed ~/.node-gyp folder and reinstalled node modules.
presleguine solution worked for me but downgrading the node to v4.4.7
I tried many suggestions and the only thing that worked is @JxnGraphix solution. Steps are:
- Delete .node-gyp from root
- Go to project directory then delete node_modules folder
- sudo npm install
Finally.... Wew!
Update: I encountered it again and instead of doing the above, this solution (symlinking node to nodejs) worked for me also.
- Go to project directory then delete node_modules folder, then do this:
sudo ln -s `which nodejs` /usr/bin/node
sudo npm install
Dang it I just don't have luck with Node these days.
I tried to downgrade the version to 4.x.x and removed node-gyp and removed node-modules from the project and still nothing... 😢
Working on RHEL6 here. Same problem with v6.2.1 Everything goes again smoothly when downgrading to v5.12.0 (I use nvm for simplicity)