简体   繁体   English

找不到命令:node-inspector

[英]command not found: node-inspector

When I run both node-inspector and node-debug app.js. 当我同时运行node-inspector和node-debug app.js时。 I receive: 我收到:

zsh: command not found: node-inspector
zsh: command not found: node-debug

Whats odd is that when I run node --debug, I receive: 奇怪的是,当我运行节点--debug时,我收到:

Debugger listening on port 5858

I recently have rerun the sudo npm install -g node-inspector 我最近重新运行了sudo npm install -g node-inspector

npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"5.0.0","npm":"3.3.6"})
npm WARN lifecycle v8-debug@0.5.4~preinstall: cannot run in wd %s %s (wd=%s) v8-debug@0.5.4   /usr/local/lib/node_modules/.staging/v8-debug-d56ef3c156d39eeb44cda4964e0a85c5
npm WARN lifecycle v8-profiler@5.3.2~preinstall: cannot run in wd %s %s (wd=%s) v8-profiler@5.3.2   /usr/local/lib/node_modules/.staging/v8-profiler-700a09d0cc4475efe8f794ecb7f798e3
/usr/local/bin/node-inspector -> /usr/local/lib/node_modules/node-inspector/bin/inspector.js
/usr/local/bin/node-debug -> /usr/local/lib/node_modules/node-inspector/bin/node-debug.js

> bufferutil@1.2.1 install /usr/local/lib/node_modules/node-inspector/node_modules/bufferutil
> node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/zfine/.node-gyp/5.0.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/node-inspector/node_modules/bufferutil/.node-gyp"
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/bufferutil.node

> utf-8-validate@1.2.1 install /usr/local/lib/node_modules/node-inspector/node_modules/utf-8-validate
> node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/zfine/.node-gyp/5.0.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/node-inspector/node_modules/utf-8-validate/.node-gyp"
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/validation.node

> bufferutil@1.2.1 install /usr/local/lib/node_modules/node-inspector/node_modules/bufferutil
> node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/zfine/.node-gyp/5.0.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/node-inspector/node_modules/bufferutil/.node-gyp"
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/bufferutil.node

> utf-8-validate@1.2.1 install /usr/local/lib/node_modules/node-inspector/node_modules/utf-8-validate
> node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/zfine/.node-gyp/5.0.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/node-inspector/node_modules/utf-8-validate/.node-gyp"
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/validation.node

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

gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/zfine/.node-gyp/5.0.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/node-inspector/node_modules/v8-debug/.node-gyp"
make: *** No rule to make target `../.node-gyp/5.0.0/include/node/common.gypi', needed by `Makefile'.  Stop.
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 15.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/usr/local/lib/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.5.4/node-v47-darwin-x64/debug.node" "--module_name=debug" "--module_path=/usr/local/lib/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.5.4/node-v47-darwin-x64"
gyp ERR! cwd /usr/local/lib/node_modules/node-inspector/node_modules/v8-debug
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/local/lib/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.5.4/node-v47-darwin-x64/debug.node --module_name=debug --module_path=/usr/local/lib/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.5.4/node-v47-darwin-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/node-inspector/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:818:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Darwin 15.0.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/node-inspector/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/node-inspector/node_modules/v8-debug
node-pre-gyp ERR! node -v v5.0.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.14
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/local/lib/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.5.4/node-v47-darwin-x64/debug.node --module_name=debug --module_path=/usr/local/lib/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.5.4/node-v47-darwin-x64' (1)
npm WARN install:v8-debug v8-debug@0.5.4 install: `node-pre-gyp install --fallback-to-build`
npm WARN install:v8-debug Exit status 1

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

gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/zfine/.node-gyp/5.0.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/node-inspector/node_modules/v8-profiler/.node-gyp"
make: *** No rule to make target `../.node-gyp/5.0.0/include/node/common.gypi', needed by `Makefile'.  Stop.
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 15.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/usr/local/lib/node_modules/node-inspector/node_modules/v8-profiler/build/profiler/v5.3.2/node-v47-darwin-x64/profiler.node" "--module_name=profiler" "--module_path=/usr/local/lib/node_modules/node-inspector/node_modules/v8-profiler/build/profiler/v5.3.2/node-v47-darwin-x64"
gyp ERR! cwd /usr/local/lib/node_modules/node-inspector/node_modules/v8-profiler
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/local/lib/node_modules/node-inspector/node_modules/v8-profiler/build/profiler/v5.3.2/node-v47-darwin-x64/profiler.node --module_name=profiler --module_path=/usr/local/lib/node_modules/node-inspector/node_modules/v8-profiler/build/profiler/v5.3.2/node-v47-darwin-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/node-inspector/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:818:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Darwin 15.0.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/node-inspector/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/node-inspector/node_modules/v8-profiler
node-pre-gyp ERR! node -v v5.0.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.14
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/local/lib/node_modules/node-inspector/node_modules/v8-profiler/build/profiler/v5.3.2/node-v47-darwin-x64/profiler.node --module_name=profiler --module_path=/usr/local/lib/node_modules/node-inspector/node_modules/v8-profiler/build/profiler/v5.3.2/node-v47-darwin-x64' (1)
npm WARN install:v8-profiler v8-profiler@5.3.2 install: `node-pre-gyp install --fallback-to-build`
npm WARN install:v8-profiler Exit status 1
/usr/local/lib
└── (empty)

npm ERR! code 1

I am running OSX 10.11.1. 我正在运行OSX 10.11.1。

node: v5.0.0 节点:v5.0.0

npm: 3.3.6 npm:3.3.6

Its possible I have messed up the PATH variable, as seen in this similar question here on Stack . 如我在Stack上的类似问题所示,我可能弄乱了PATH变量。 However their PATH looks different. 但是,它们的PATH看起来有所不同。 If this is in fact the case do I need to add an export PATH to my .bash_profile? 如果确实如此,我是否需要向.bash_profile添加导出路径? Thanks in advance!! 提前致谢!!

It should work if you pass --unsafe-perm on the command line. 如果在命令行上通过--unsafe-perm,它应该可以工作。

Like: $ sudo npm install -g pkg_name --unsafe-perm 像:$ sudo npm install -g pkg_name --unsafe-perm

Reason: on OSX El Capitan, apple remove full access of super user for some security issues. 原因:在OSX El Capitan上,苹果出于某些安全问题删除了超级用户的完全访问权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM