node-gyp icon indicating copy to clipboard operation
node-gyp copied to clipboard

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

Open brascosDad opened this issue 11 years ago • 251 comments

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

brascosDad avatar Nov 09 '15 02:11 brascosDad

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...

brascosDad avatar Nov 09 '15 02:11 brascosDad

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

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

bnoordhuis avatar Nov 09 '15 10:11 bnoordhuis

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

brascosDad avatar Nov 09 '15 15:11 brascosDad

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.

bnoordhuis avatar Nov 09 '15 15:11 bnoordhuis

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..(?)

> [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
[email protected] /Users/ernest son/Desktop/PROJECTS/musicomp
├─┬ [email protected]
│ └─┬ [email protected]
│   └─┬ [email protected]
│     └── [email protected] 
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected] 
│ │   └── [email protected] 
│ └─┬ [email protected]
│   └── [email protected] 
├─┬ [email protected]
│ └─┬ [email protected]
│   └── [email protected] 
├─┬ [email protected]
│ └─┬ [email protected]
│   └─┬ [email protected]
│     ├── [email protected] 
│     └── [email protected] 
├─┬ [email protected]
│ └─┬ [email protected]
│   └── [email protected] 
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected] 
│ │   └── [email protected] 
│ └─┬ [email protected]
│   └── [email protected] 
├─┬ [email protected]
│ └─┬ [email protected]
│   └─┬ [email protected]
│     └── [email protected] 
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   └─┬ [email protected]
│ │     └─┬ [email protected]
│ │       └── [email protected] 
│ └─┬ [email protected]
│   └── [email protected] 
└─┬ [email protected]
  └─┬ [email protected]
    └─┬ [email protected]
      └── [email protected] 

brascosDad avatar Nov 09 '15 15:11 brascosDad

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

bnoordhuis avatar Nov 09 '15 15:11 bnoordhuis

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

brascosDad avatar Nov 09 '15 15:11 brascosDad

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

bnoordhuis avatar Nov 09 '15 15:11 bnoordhuis

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

brascosDad avatar Nov 09 '15 15:11 brascosDad

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

bnoordhuis avatar Nov 09 '15 18:11 bnoordhuis

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 [email protected] 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 https://github.com/nodejs/node-gyp/issues/809#issuecomment-155150352.

brascosDad avatar Nov 09 '15 19:11 brascosDad

getting same problem here when trying to install ember-cli

mmahalwy avatar Nov 09 '15 22:11 mmahalwy

same problem here with contextify.

neoadventist avatar Nov 10 '15 23:11 neoadventist

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!

brascosDad avatar Nov 11 '15 01:11 brascosDad

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.

midhunadarvin avatar Nov 29 '15 13:11 midhunadarvin

Same with botkit. https://github.com/howdyai/botkit/issues/2

kevinSuttle avatar Dec 16 '15 04:12 kevinSuttle

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!

aroc avatar Dec 16 '15 04:12 aroc

@aroc It doesn't helped for me :(

irudoy avatar Dec 16 '15 04:12 irudoy

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

JxnGraphix avatar Dec 16 '15 17:12 JxnGraphix

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

kevinSuttle avatar Dec 16 '15 17:12 kevinSuttle