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
just downgrade node version 8 on mac
@alexey-sh I have the same problem @isha93 how to do this?
just downgrade your node version bro @mesqueeb but it's wokr on mac in my case
@isha93 How to downgrade the node version bro
sudo npm cache clean -f sudo npm install -g n sudo n 8.11.1 try this @mesqueeb
My many hours of pain ended with a pretty simple fix after nothing in this thread (and many others!) worked.
Check your package.json for modules you're no longer using. I was having issues already with vue-highlightjs and had previously uninstalled it, only to later try to install packages and receive this error. Upon the removal of the respective entry from my dependencies I could yarn without any issues.
Running Manjaro on kernel 4.14.71-1-MANJARO with Node.js 10.11.0, NPM 6.4.1, node-gyp 3.8.0, Yarn 1.9.4, and nvm 0.33.11. Time to go have dinner.
This worked for me: (original comment by @dwieeb)
@smallg You're getting permission errors for
/usr/local/lib/node_modules. This is not an ionic issue, but an issue with your npm setup. See the npm docs: https://docs.npmjs.com/getting-started/fixing-npm-permissionsYou can also do the following:
sudo chown -R $(whoami):staff /usr/local/lib/node_modulesThis will change the directory owner to be your personal account. Then, never use
sudowithnpm.
https://github.com/ionic-team/ionic-cli/issues/3127#issuecomment-387791251
For me, after I Downgrade the node's version it works finally.
$ brew install node@8 // install node8
$ brew unlink node // unlink old one
$ brew link node@8 // link node version 8
$ brew link --overwrite --force node@8 // force link version 8
Here are two reference page about Downgrade Node and force link to node 8.
@isha93 How to downgrade the node version bro
use nvm to manage node versions...it's super awessome http://nvm.sh
Just in case anyone else wants to try a different solution, installing g++ with sudo apt-get install g++
solved this issue for me.
I did yarn instead of npm install....and it worked
For me, just deleting the
~/.node-gypfolder, then runningnpm updateon my project solved the problem (without rebooting). Thank for the trick!
it works
For me, after I Downgrade the node's version it works finally.
$ brew install node@8// install node8
$ brew unlink node// unlink old one
$ brew link node@8// link node version 8
$ brew link --overwrite --force node@8// force link version 8Here are two reference page about Downgrade Node and force link to node 8.
I was using node v11 as default from homebrew, and downgrading to node@10 works! thanx
I've noticed node-gyp tends to get it's wires crossed sometimes when I upgrade packages that use it, and has to be removed (rm -rf node_modules) and re-installed in order to work correctly.
I've had this issue with node-sass before, and now I ran into it again with ionic.
I could be wrong, but I believe there is something in there running a c/c++ compiler to create files that are specific to your local system, and for some reason updating dependencies throws those compiled files out of whack. They live in either the node_modules folder or the $HOME/.node-gyp folder so removing those folders and reinstalling has always fixed the problem for me.
yum install gcc-c++
Running this solved the problem for me.
Removing $HOME/.node-gyp worked for me. I think there were node version mismatch issues.
I received the following error:
[email protected] install: node-gyp rebuild
A few lines below it, I received this error which I failed to read:
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
Solution: Installed xcode
i had solved this by downgrading the node and npm versions
Before versions:
node - v10.14.2 npm - 6.5.0
i had downgraded to below versions
After versions :
node - v8.11.3 npm - 5.6.0
this issue will be resolved,please try if any one still facing the issue
This is what worked for me on Windows:
- Download and install Python 2.7.3 (if you have Python 3.x already installed, just leave it, both can coexist)
- npm config set python /Python27/python.exe --global
- npm rebuild node-sass --force
I'm hitting this issue with the downgraded versions of node - v8.11.3 and npm - 5.6.0. Any other ideas?