Node.js 未找到命令:节点检查器

Node.js 未找到命令:节点检查器,node.js,express,node-inspector,Node.js,Express,Node Inspector,当我运行node inspector和node debug app.js时。我收到: zsh: command not found: node-inspector zsh: command not found: node-debug Debugger listening on port 5858 奇怪的是,当我运行node--debug时,我收到: zsh: command not found: node-inspector zsh: command not found: node-debu

当我运行node inspector和node debug app.js时。我收到:

zsh: command not found: node-inspector
zsh: command not found: node-debug
Debugger listening on port 5858
奇怪的是,当我运行node--debug时,我收到:

zsh: command not found: node-inspector
zsh: command not found: node-debug
Debugger listening on port 5858
我最近重新运行了sudonpm安装-g节点检查器

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
npm警告引擎xmlbuilder@2.2.1:通缉:{“节点”:“0.8.x | | 0.10.x”}(当前:{“节点”:“5.0.0”,“npm”:“3.3.6”})
npm警告生命周期v8-debug@0.5.4~preinstall:无法在wd%s%s(wd=%s)v8中运行-debug@0.5.4/usr/local/lib/node_modules/.staging/v8-debug-d56ef3c156d39eeb44cda4964e0a85c5
npm警告生命周期v8-profiler@5.3.2~preinstall:无法在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安装/usr/local/lib/node_modules/node inspector/node_modules/bufferutil
>节点gyp重建
gyp WARN EACCES用户“root”无权访问dev dir“/Users/zfine/.node gyp/5.0.0”
gyp警告试图使用临时dev dir“/usr/local/lib/node_modules/node inspector/node_modules/bufferutil/.node gyp”重新安装的EACCES
CXX(目标)发布/obj.target/bufferutil/src/bufferutil.o
SOLINK_模块(目标)发布/bufferutil.node
>utf-8-validate@1.2.1安装/usr/local/lib/node_modules/node inspector/node_modules/utf-8-validate
>节点gyp重建
gyp WARN EACCES用户“root”无权访问dev dir“/Users/zfine/.node gyp/5.0.0”
gyp警告试图使用临时dev dir“/usr/local/lib/node_modules/node inspector/node_modules/utf-8-validate/.node gyp”重新安装的EACCES
CXX(目标)发布/obj.target/validation/src/validation.o
SOLINK_模块(目标)发布/验证.node
> bufferutil@1.2.1安装/usr/local/lib/node_modules/node inspector/node_modules/bufferutil
>节点gyp重建
gyp WARN EACCES用户“root”无权访问dev dir“/Users/zfine/.node gyp/5.0.0”
gyp警告试图使用临时dev dir“/usr/local/lib/node_modules/node inspector/node_modules/bufferutil/.node gyp”重新安装的EACCES
CXX(目标)发布/obj.target/bufferutil/src/bufferutil.o
SOLINK_模块(目标)发布/bufferutil.node
>utf-8-validate@1.2.1安装/usr/local/lib/node_modules/node inspector/node_modules/utf-8-validate
>节点gyp重建
gyp WARN EACCES用户“root”无权访问dev dir“/Users/zfine/.node gyp/5.0.0”
gyp警告试图使用临时dev dir“/usr/local/lib/node_modules/node inspector/node_modules/utf-8-validate/.node gyp”重新安装的EACCES
CXX(目标)发布/obj.target/validation/src/validation.o
SOLINK_模块(目标)发布/验证.node
>v8-debug@0.5.4安装/usr/local/lib/node_modules/node inspector/node_modules/v8调试
>节点预gyp安装--回退到构建
gyp WARN EACCES用户“root”无权访问dev dir“/Users/zfine/.node gyp/5.0.0”
gyp警告试图使用临时dev dir“/usr/local/lib/node_modules/node inspector/node_modules/v8 debug/.node gyp”重新安装的EACCES
make:**Makefile所需的目标“...node gyp/5.0.0/include/node/common.gypi”无规则生成。停止
哎呀!构建错误
哎呀!堆栈错误:`make`失败,退出代码:2
哎呀!堆栈位于ChildProcess.onExit(/usr/local/lib/node_modules/npm/node_modules/node gyp/lib/build.js:270:23)
哎呀!在emitTwo处堆栈(events.js:87:13)
哎呀!ChildProcess.emit处的堆栈(events.js:172:7)
哎呀!在Process.ChildProcess.\u handle.onexit(internal/child\u Process.js:200:12)处堆栈
哎呀!达尔文系统15.0.0
哎呀!命令“/usr/local/bin/node”“/usr/local/lib/node_modules/npm/node_modules/node gyp/node gyp.js”“build”“--fallback to build”“--module=/usr/local/lib/node_modules/node inspector/node_modules/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
GypErr!节点-v5.0.0
gyp ERR!节点gyp-v3.0.3
哎呀!不行
节点预gyp错误!生成错误
node pre-gyp ERR!堆栈错误:未能执行'/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调试/build/debug/v0.5.4/node-v47-darwin-x64/debug.node--name=debug--调试--module--调试--module module----调试--modulees/node inspector/node_模块/v8调试/构建/调试/v0.5.4/node-v47-darwin-x64'(1)

node pre-gyp ERR!stack at ChildProcess..但是它们的路径看起来不同。如果事实如此,我是否需要向我的.bash_配置文件添加导出路径?提前感谢!!

如果在命令行上传递--unsafe perm,应该可以使用

比如: $sudo npm install-g pkg_name--不安全的perm

原因:在OSX El Capitan上,苹果因为一些安全问题取消了超级用户的完全访问权限