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
do not have a space in my filepath. I deleted the ~/.node-gyp folder . Restarted my computer. Then tried again and still didnt work.
Can someone help me.
@nidhi-singh02 Please check the version of nodejs and npm in above comments and compare with yours
Downgrade or upgrade the packages accordingly.
I fix this disabling pyton3 by default in my shell config.
I tried by upgrading or downgrading the version of node , but nothing helped. There was a mismatch between the version which I was installing and the versions mentioned in package.json file.
I tried installing the version specified in package.json file to new path by removing all the exisiting paths. It solved my problem.
Its been 4 years now, and still this issue remains??
How is the issue closed when it's clearly still a problem?
Downgrade to a once semi-usable version of NodeJS (v8^) and delete node v10^ artifacts:
rm -rf ~/.node-gyp
rm ~/.npmrc
rm -rf ~/npm
rm -rf node_modules # <- in project folder
sudo apt-get remove nodejs
curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -
sudo apt-get install -y nodejs
It will work with npm install and yarn install then.
I should note that I also installed build-essentials and libkrb5-dev as per comments above, AND have set the python version to 2.7 like so: npm config set python /usr/bin/python2.7, just because I was following along with all the comments and trying everything.
No restart was necessary.
What a sad, sorry state we've driven the industry into when it's more complex to "compile" a bunch of code written in a toy language than it was to parse punch cards in the 1970s or develop a censorship-resistant world computer.
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/
Thanks, this has fixed the issue for me...
sudo npm i
I had to downgrade my node version, I used nvm as suggested by @knoxcard and it worked.
In my setup, the error was a python one. I has a conda environment activated that used python 3.6, while the code required 2.7
If you don't want to change your conda setup, this will allow you to go through with the installation:
PATH=/usr/bin:$PATH yarn install
Otherwise just run without conda enabled, or switch to a 2.7 environement.
Platform: OSX 10.14.3 node: 11.11.0 yarn: 1.13.0 conda: 4.6.7
Why this issue is closed an still occur ? I tested on two version, node 8 and 10 and is the same issue. This is unacceptable. After 4 year nobody found a solution for this ? Not even a workaround, nothing work. Shame !!
Why this issue is closed an still occur ? I tested on two version, node 8 and 10 and is the same issue. This is unacceptable. After 4 year nobody found a solution for this ? Not even a workaround, nothing work. Shame !!
Me too. Still have this error. 😞
This error is still bothering me and I've spent way too much time with finding a solution without having to reinstall Windows. If anyone is having trouble installing a specific package and don't have time to fix this error, I found a work around by just using another package manager; switching to yarn add package-name worked for me. I will eventually reinstall windows to fix this error, which is annoying.
yum install gcc-c++Running this solved the problem for me.
in fedora 29 this solved a big part of problem thx !!
Running npm audit fix or npm audit fix --force solved the problem for me
For me, just deleting the
~/.node-gypfolder, then runningnpm updateon my project solved the problem (without rebooting). Thank for the trick!
fk yeah boy worked for me
npm install --global --production windows-build-tools
solved my problem
I am not seeing here any concrete answer for this Problem.
- downgrading node version help this problem but then node-sass gives problem. Can anyone please write me solution for this problem without downgrading node version? (I have node v12)
Same thing for me