npm install gives node-gyp error

喜你入骨 提交于 2019-12-25 03:44:18

问题


I recently switched back to node from iojs, finally got the install to work for node and npm, but now can't get my project's dev dependencies loaded. npm install yields the following...

> 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 

I tried removing $HOME/.node-gyp and also fixing the space in my user name. Restarted, but still getting issues with node-gyp. Can anyone help? Thanks


回答1:


the root of the problem lay in that my home folder had a space in it. After that was fixed everything ran smoothly!



来源:https://stackoverflow.com/questions/33613644/npm-install-gives-node-gyp-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!