Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trying to 'npm install', getting node-gyp rebuild errors #809

Closed
brascosDad opened this issue Nov 9, 2015 · 251 comments
Closed

trying to 'npm install', getting node-gyp rebuild errors #809

brascosDad opened this issue Nov 9, 2015 · 251 comments

Comments

@brascosDad
Copy link

ernestscomputer:musicomp ernest son$ npm install

> bufferutil@1.2.1 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: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 /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:utf-8-validate@1.2.1 utf-8-validate@1.2.1 install: `node-gyp rebuild`
npm WARN install:utf-8-validate@1.2.1 Exit status 1
@brascosDad
Copy link
Author

back story: in trying to uninstall iojs and reinstall node, I entered a world of shizzao but finally got node and npm installed successfully....I tried installing node-gyp globally to no avail...

@bnoordhuis
Copy link
Member

Delete your $HOME/.node-gyp directory and try again.

Aside, many tools don't handle spaces in path names well (/Users/ernest son/...).

@brascosDad
Copy link
Author

sorry, when you say "$home" do you essentially mean usr/local/bin? that's what "which node-gyp" yields in term...or do you mean another location?

I did change my user name by eliminating space for "_". thanks for the heads up

@bnoordhuis
Copy link
Member

I mean the HOME environment variable. :-) node-gyp normally downloads the development tarballs to $HOME/.node-gyp, i.e., /home/username/.node-gyp or /Users/username/.node-gyp.

@brascosDad
Copy link
Author

thanks, i figured out what you meant....just tried npm install and it appears i still have rebuild issues. it looks as though my user rename didn't propogate..(?)

> bufferutil@1.2.1 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: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 /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:utf-8-validate@1.2.1 utf-8-validate@1.2.1 install: `node-gyp rebuild`
npm WARN install:utf-8-validate@1.2.1 Exit status 1
musiComp@1.0.0 /Users/ernest son/Desktop/PROJECTS/musicomp
├─┬ gulp@3.9.0
│ └─┬ vinyl-fs@0.3.14
│   └─┬ through2@0.6.5
│     └── readable-stream@1.0.33 
├─┬ gulp-clean@0.3.1
│ ├─┬ gulp-util@2.2.20
│ │ └─┬ through2@0.5.1
│ │   ├── readable-stream@1.0.33 
│ │   └── xtend@3.0.0 
│ └─┬ through2@0.4.2
│   └── readable-stream@1.0.33 
├─┬ gulp-concat@2.6.0
│ └─┬ through2@0.6.5
│   └── readable-stream@1.0.33 
├─┬ gulp-cssmin@0.1.7
│ └─┬ gulp-util@2.2.20
│   └─┬ through2@0.5.1
│     ├── readable-stream@1.0.33 
│     └── xtend@3.0.0 
├─┬ gulp-jshint@1.12.0
│ └─┬ through2@0.6.5
│   └── readable-stream@1.0.33 
├─┬ gulp-karma@0.0.5
│ ├─┬ gulp-util@2.2.20
│ │ └─┬ through2@0.5.1
│ │   ├── readable-stream@1.0.33 
│ │   └── xtend@3.0.0 
│ └─┬ optimist@0.6.1
│   └── minimist@0.0.10 
├─┬ gulp-ruby-sass@2.0.5
│ └─┬ vinyl-fs@1.0.0
│   └─┬ through2@0.6.5
│     └── readable-stream@1.0.33 
├─┬ karma@0.13.14
│ ├─┬ chokidar@1.2.0
│ │ └─┬ fsevents@1.0.5
│ │   └─┬ node-pre-gyp@0.6.15
│ │     └─┬ tar-pack@3.1.0
│ │       └── readable-stream@1.0.33 
│ └─┬ log4js@0.6.27
│   └── readable-stream@1.0.33 
└─┬ phantomjs@1.9.18
  └─┬ request@2.42.0
    └─┬ bl@0.9.4
      └── readable-stream@1.0.33 

@bnoordhuis
Copy link
Member

Maybe you need to log out and log in again? It's also possible that $HOME/.npmrc has some outdated variables.

@brascosDad
Copy link
Author

so redelete $HOME/.node-gyp and also .npmrc? logout and try again? I already restarted after user name change...

@bnoordhuis
Copy link
Member

Maybe just edit your .npmrc in case it contains valuable things like tokens.

@brascosDad
Copy link
Author

i see a .rvmrc folder in $HOME, but no .npmrc.....and how exactly would I edit it (if I could find it)?

@bnoordhuis
Copy link
Member

If you don't have a .npmrc, don't worry about it. If you do, just vim will do; it's a text file.

@brascosDad
Copy link
Author

I don't have one...any other ideas? I think I've tried everything on our
list
On Mon, Nov 9, 2015 at 1:39 PM Ben Noordhuis notifications@github.com
wrote:

If you don't have a .npmrc, don't worry about it. If you do, just vim will
do; it's a text file.


Reply to this email directly or view it on GitHub
#809 (comment).

@mmahalwy
Copy link

mmahalwy commented Nov 9, 2015

getting same problem here when trying to install ember-cli

@neoadventist
Copy link

same problem here with contextify.

@brascosDad
Copy link
Author

for me, the solution was fixing the space in my home folder (that was a whole other "can o' worms"). then 'npm install' worked like a charm. also, I suggest reaching out to the folks at npm if it truly is npm related. They're great!

@midhunadarvin
Copy link

I also had the node-gyp rebuild error while installing utf-8-validate package through npm. Removing the space from my filepath worked for me.

@kevinSuttle
Copy link

Same with botkit. howdyai/botkit#2

@aroc
Copy link

aroc commented Dec 16, 2015

Ok, so I do not have a space in my filepath. I deleted the ~/.node-gyp folder and then the ~/.npmrc file. Restarted my computer. Then tried again and it worked. Hope that helps someone else out there!

@irudoy
Copy link

irudoy commented Dec 16, 2015

@aroc It doesn't helped for me :(

@JxnGraphix
Copy link

Thanks @bnoordhuis! I had the same issue with no spaces in my file path. Deleting the original node_modules folder from my project, then deleting .node-gyp (I did not have .npmrc), restarting, and installing node in my project again with (sudo npm install) worked with no errors.

Node v5.2.0

@kevinSuttle
Copy link

Yikes. It scares me to think how low-level this is that a machine restart is a potential solution...

@UriKatz
Copy link

UriKatz commented Dec 22, 2015

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/

@samgranger
Copy link

I already had build-essential installed, installing libkrb5-dev did the trick for me:

apt-get install libkrb5-dev

@ByScripts
Copy link

For me, just deleting the ~/.node-gyp folder, then running npm update on my project solved the problem (without rebooting). Thank for the trick!

@josephgodwinkimani
Copy link

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

@barnash
Copy link

barnash commented Feb 18, 2016

I also deleted the node_modules directory I had (including .node-gyp and all), solved my issue. No restart.

@mylonasg88
Copy link

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

@blin17
Copy link

blin17 commented Feb 28, 2016

Thanks @JxnGraphix - your solution worked for me

Node v5.7.0

@timbergus
Copy link

Could be node-sass? It compiles every time I install it.

@richardlau
Copy link
Member

Could be node-sass? It compiles every time I install it.

Could be. node-sass v4.12.0 adds support for Node.js 12: https://github.com/sass/node-sass/releases/tag/v4.12.0

@timbergus
Copy link

Thanks, @richardlau. I will try to follow node-sass node@12.x compatibility issues.

@Rafael-Ramblas
Copy link

This has done the job
Node 12.1.0, npm 6.9.0
Remove node-gyp
Update to node-sass 4.12.0
npm update
npm audit fix --force

@eduardomart
Copy link

After trying a gazillion things, only @punitnathani's solution worked for me.

@kukoman
Copy link

kukoman commented May 22, 2019

tried pretty much every suggestion and nothing works :/ anyone has a working solution without downgrading node?

@strarsis
Copy link

@kukoman: If it is node-sass, upgrading it (node-sass) usually solved these issues for me.

@kukoman
Copy link

kukoman commented May 22, 2019

@strarsis did try to downgrade node-sass, removing it, reinstalling, deleting cache, removing and reinstalling gyp... still no joy :/

@strarsis
Copy link

strarsis commented May 22, 2019

@kukoman: No, upgrade node-sass to the latest version (4.12.0 (atw), see https://www.npmjs.com/package/node-sass).

@hakoiko
Copy link

hakoiko commented May 23, 2019

In my case,
I removed package-lock.json and node_modules folder. and npm install
tada! everything works fine

@belvederef
Copy link

belvederef commented May 24, 2019

Nothing of what suggested above worked for me, however, I solved my issue switching to a different node version (e.g. using nvm).

@kukoman
Copy link

kukoman commented May 24, 2019 via email

@mrpandat
Copy link

Switching from node v12.3.1 to v8.16.0 with nvm solved this for me.

Thanks @belvederef 🎉

@nbeers22
Copy link

nbeers22 commented Jun 9, 2019

used nvm and downgraded to node v11.10.0, which solved my problem

@woprandi
Copy link

I always have a problem to rebuild a old ember app despite a yarn.lock because of this package, unacceptable...

@strarsis
Copy link

@woprandi: The system itself differs from the one where the bindings compilation worked,
so it fails, this shouldn't happen, but this package has this kind of issue.
You could try to install the app dependencies inside a VM/container that runs on an older *nix distribution (from which you know that it worked in the past) and hopefully it compiles.

@pthornhi
Copy link

Only @punitnathani's solution worked for me. Downgrade from node@12.x.x

to

npm install -g node@11.10.0

@Daisuke-sama
Copy link

For me as well @pthornhi . I had spent, probably, a few days for experiments...

@shaikh-shahid
Copy link

Follow these steps to resolve the issue.

1: Make sure you have build-tools installed.
2: Update node-gyp
3: Delete package-lock.json and node modules folder and run npm install again.
4: Deleting ~/.node-gyp folder and run npm install again.

Source: https://codeforgeek.com/make-failed-with-exit-code-2/

@mikkz
Copy link

mikkz commented Jun 20, 2019

For those who are using AMI 2, I resolve it using

sudo yum groupinstall "Development Tools"

Since my errors were

make: Entering directory `/home/www/tieza-queue/notification/node_modules/fibers/build'
  CXX(target) Release/obj.target/fibers/src/fibers.o
make: g++: Command not found
make: *** [Release/obj.target/fibers/src/fibers.o] Error 127
make: Leaving directory `/home/www/tieza-queue/notification/node_modules/fibers/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/ec2-user/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.14.114-105.126.amzn2.x86_64
gyp ERR! command "/home/ec2-user/.nvm/versions/node/v10.15.3/bin/node" "/home/ec2-user/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /home/www/tieza-queue/notification/node_modules/fibers
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: `sudo apt-get install g++ build-essential`
Alpine users please run: `sudo apk add python make g++`
sh: nodejs: command not found
npm WARN acorn-jsx@5.0.1 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN notification@1.0.0 No description
npm WARN notification@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! fibers@2.0.2 install: `node build.js || nodejs build.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the fibers@2.0.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ec2-user/.npm/_logs/2019-06-20T07_19_19_837Z-debug.log

@yankikucuk
Copy link

@pthornhi its worked for me.

@MagicScorpion
Copy link

I am getting below error while installing btlejuice.

gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.19.0-kali4-amd64
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/btlejuice/node_modules/bluetooth-hci-socket
gyp ERR! node -v v10.15.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

@orwell1984
Copy link

Gotta love hundreds of people checking in on a closed issue to no avail. Good maintainer ethics!

@bzoz
Copy link
Contributor

bzoz commented Jun 25, 2019

This page is for that specific issue from 3yrs ago, which was solved. It is not catch-all place for all node-gyp failures. If you have issues with building a node module:

  • open an issue in that module issue tracker,
  • if that does not help and you are suspecting issue with node-gyp itself, open new issue here with your specific system config and error message

@nodejs nodejs locked as resolved and limited conversation to collaborators Jun 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests