【问题标题】:How to properly install node-inspector on OSX Yosemite with node.js 0.12?如何使用 node.js 0.12 在 OSX Yosemite 上正确安装 node-inspector?
【发布时间】:2015-02-12 19:33:33
【问题描述】:

我正在尝试使用以下命令安装节点检查器:

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,也安装了ws。

【问题讨论】:

  • 我也遇到了同样的问题,你找到解决办法了吗?

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


【解决方案1】:

一旦我将节点降级到 v0.10.36,它就可以工作

sudo npm cache clean -f
sudo npm install -g n
sudo n 0.10.36

【讨论】:

  • 感谢@iwan,清理缓存并切换到 0.10.36 已经完成,但我在 getcwd 上获得了额外的权限被拒绝。我用sudo chown -R 'whoami' /usr/local 更改了目录权限(/usr/local)并在没有sudo 的情况下启动了npm install -g node-inspector,然后它工作了。老实说,我不确定这个程序可以解决问题。
猜你喜欢
  • 2015-04-08
  • 1970-01-01
  • 1970-01-01
  • 2015-01-04
  • 1970-01-01
  • 1970-01-01
  • 2014-07-28
  • 2018-07-16
  • 1970-01-01
相关资源
最近更新 更多