如何在node.js 0.12的OSX Yosemite上正确安装node-inspector?

时间:2015-02-12 19:33:33

标签: javascript node.js macos installation node-inspector

我正在尝试使用以下命令安装node-inspector:

sudo npm install -g node-inspector

我得到以下结果:

> ws@0.4.32 install /usr/local/lib/node_modules/node-inspector/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied

> v8-debug@0.3.5 install /usr/local/lib/node_modules/node-inspector/node_modules/v8-debug
> node-pre-gyp install --fallback-to-build

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
sh: node-pre-gyp: command not found

> v8-profiler@5.2.3 install /usr/local/lib/node_modules/node-inspector/node_modules/v8-profiler
> node-pre-gyp install --fallback-to-build

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
sh: node-pre-gyp: command not found
npm ERR! v8-debug@0.3.5 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 127
npm ERR! 
npm ERR! Failed at the v8-debug@0.3.5 install script.
npm ERR! This is most likely a problem with the v8-debug package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR!     npm owner ls v8-debug
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 14.1.0
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "node-inspector"
npm ERR! cwd /Users/alan
npm ERR! node -v v0.12.0
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

我已经成功安装了node-pre-gyp,并且也是。

1 个答案:

答案 0 :(得分:2)

一旦我将节点降级到v0.10.36

,它就可以工作了
sudo npm cache clean -f
sudo npm install -g n
sudo n 0.10.36