npm install 给出 node-gyp 错误

npm install gives node-gyp error

我最近从 iojs 切换回 node,终于安装了 node 和 npm,但现在无法加载我项目的开发依赖项。 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
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 

我尝试删除 $HOME/.node-gyp 并修复我用户名中的 space。重新启动,但仍然遇到 node-gyp 问题。谁能帮忙?谢谢

问题的根源在于我的主文件夹中有一个 space。之后一切都修好了 运行 顺利!