找不到node-inspector命令

时间:2013-07-27 19:01:52

标签: node-inspector

我尝试使用一堆不同的命令安装并运行node-inspector但仍然无法运行它:

Jordans-MacBook-Pro:angular-express-blog jordanbaucke$ node-inspector
-bash: node-inspector: command not found

这是我的配置

Jordans-MacBook-Pro:angular-express-blog jordanbaucke$ node -v
v0.10.15
Jordans-MacBook-Pro:angular-express-blog jordanbaucke$ npm -v
1.3.5

我安装使用:

Jordans-MacBook-Pro:angular-express-blog jordanbaucke$ sudo npm install -g node-inspector
Password:
npm http GET https://registry.npmjs.org/node-inspector
npm http 304 https://registry.npmjs.org/node-inspector
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/express
npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/socket.io
npm http 304 https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/commander/0.6.1
npm http GET https://registry.npmjs.org/connect/2.7.11
npm http GET https://registry.npmjs.org/range-parser/0.0.4
npm http GET https://registry.npmjs.org/mkdirp/0.3.4
npm http GET https://registry.npmjs.org/cookie/0.1.0
npm http GET https://registry.npmjs.org/buffer-crc32/0.2.1
npm http GET https://registry.npmjs.org/fresh/0.1.0
npm http GET https://registry.npmjs.org/methods/0.0.1
npm http GET https://registry.npmjs.org/cookie-signature/1.0.1
npm http GET https://registry.npmjs.org/send/0.1.0
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/base64id/0.1.0
npm http GET https://registry.npmjs.org/policyfile/0.0.4
npm http GET https://registry.npmjs.org/redis/0.7.3
npm http GET https://registry.npmjs.org/socket.io-client/0.9.16
npm http 304 https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/commander/0.6.1
npm http 304 https://registry.npmjs.org/connect/2.7.11
npm http 304 https://registry.npmjs.org/mkdirp/0.3.4
npm http 304 https://registry.npmjs.org/range-parser/0.0.4
npm http 304 https://registry.npmjs.org/cookie/0.1.0
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/buffer-crc32/0.2.1
npm http 304 https://registry.npmjs.org/fresh/0.1.0
npm http 304 https://registry.npmjs.org/cookie-signature/1.0.1
npm http 304 https://registry.npmjs.org/methods/0.0.1
npm http 304 https://registry.npmjs.org/send/0.1.0
npm http 304 https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/base64id/0.1.0
npm http 304 https://registry.npmjs.org/policyfile/0.0.4
npm http 304 https://registry.npmjs.org/socket.io-client/0.9.16
npm http 304 https://registry.npmjs.org/redis/0.7.3
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/sigmund
npm http GET https://registry.npmjs.org/mime/1.2.6
npm http GET https://registry.npmjs.org/formidable/1.0.14
npm http GET https://registry.npmjs.org/cookie/0.0.5
npm http GET https://registry.npmjs.org/bytes/0.2.0
npm http GET https://registry.npmjs.org/send/0.1.1
npm http GET https://registry.npmjs.org/pause/0.0.1
npm http GET https://registry.npmjs.org/qs/0.6.5
npm http 304 https://registry.npmjs.org/mime/1.2.6
npm http 304 https://registry.npmjs.org/pause/0.0.1
npm http 304 https://registry.npmjs.org/qs/0.6.5
npm http GET https://registry.npmjs.org/uglify-js/1.2.5
npm http GET https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http GET https://registry.npmjs.org/xmlhttprequest/1.4.2
npm http GET https://registry.npmjs.org/ws
npm http 304 https://registry.npmjs.org/cookie/0.0.5
npm http 304 https://registry.npmjs.org/formidable/1.0.14
npm http 304 https://registry.npmjs.org/bytes/0.2.0
npm http 304 https://registry.npmjs.org/send/0.1.1
npm http 304 https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http 304 https://registry.npmjs.org/xmlhttprequest/1.4.2
npm http 304 https://registry.npmjs.org/ws
npm http GET https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/uglify-js/1.2.5
npm http GET https://registry.npmjs.org/zeparser/0.0.5
npm http 304 https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/tinycolor
npm http GET https://registry.npmjs.org/options
npm http GET https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/zeparser/0.0.5
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/options
npm http 304 https://registry.npmjs.org/tinycolor

> ws@0.4.27 install /usr/local/share/npm/lib/node_modules/node-inspector/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/bufferutil.node
  SOLINK_MODULE(target) Release/bufferutil.node: Finished
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/validation.node
  SOLINK_MODULE(target) Release/validation.node: Finished
/usr/local/share/npm/bin/node-inspector -> /usr/local/share/npm/lib/node_modules/node-inspector/bin/inspector.js
node-inspector@0.3.2 /usr/local/share/npm/lib/node_modules/node-inspector
├── async@0.2.9
├── glob@3.2.6 (inherits@2.0.0, minimatch@0.2.12)
├── express@3.2.6 (methods@0.0.1, fresh@0.1.0, range-parser@0.0.4, cookie-signature@1.0.1, buffer-crc32@0.2.1, cookie@0.1.0, debug@0.7.2, commander@0.6.1, mkdirp@0.3.4, send@0.1.0, connect@2.7.11)
└── socket.io@0.9.16 (base64id@0.1.0, policyfile@0.0.4, redis@0.7.3, socket.io-client@0.9.16)

仍然没有变化。

节点运行正常,node --debug app.js有效。

我无法启动检查员。

OS X 10.8.4

4 个答案:

答案 0 :(得分:5)

以下是问题的关键:

/usr/local/share/npm/bin/node-inspector -> /usr/local/share/npm/lib/node_modules/node-inspector/bin/inspector.js

确保/usr/local/share/npm/binPATH环境变量中。

或者,您可以使用完整路径

运行node-inspector
$ /usr/local/share/npm/bin/node-inspector

答案 1 :(得分:5)

未全局安装node-inspector时会发生此错误。

要全局安装,请使用 npm install -g node-inspector

如果您没有root权限,请尝试以下操作: sudo npm install -g node-inspector

答案 2 :(得分:1)

我在Windows服务器上遇到了这个问题。节点检查器模块已全局安装。但是,系统路径中缺少的是全局安装的节点模块的目录 - 在我的情况下是

C:\ Program Files \ nodejs \ node_modules \ npm;

更新路径(如@Prasad&post文章中所述)解决了我在Windows机器上运行node-debug的问题。

答案 3 :(得分:0)

请尝试此操作 -

打开cmd提示

npm config获取前缀

你这样做了 -

C:> npm config获取前缀 C:\ Users \用户名\应用程序数据\漫游\ NPM

C:>设置PATH =%PATH%; C:\ Users \ yourusername \ AppData \ Roaming \ npm;

解决了!