2

当我运行 npm install node-inspector 时,我得到以下信息:

....

GET https://registry.npmjs.org/policyfile/0.0.4
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/formidable
npm http 304 https://registry.npmjs.org/socket.io-client/0.9.8
npm http 304 https://registry.npmjs.org/redis/0.7.2
npm http 304 https://registry.npmjs.org/policyfile/0.0.4
npm http 304 https://registry.npmjs.org/formidable
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/hiredis
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.2.2
npm http GET https://registry.npmjs.org/ws
npm http 304 https://registry.npmjs.org/hiredis

> hiredis@0.1.14 preinstall C:\apache\expTest\node_modules\node-inspector\node_modules\socket.io\node_modules\redis\node_modules\hiredis
> make || gmake

npm http 304 https://registry.npmjs.org/uglify-js/1.2.5
npm http 304 https://registry.npmjs.org/ws
npm http 304 https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http 304 https://registry.npmjs.org/xmlhttprequest/1.2.2
'make' is not recognized as an internal or external command,
operable program or batch file.
'gmake' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! error installing hiredis@0.1.14
npm ERR! error installing redis@0.7.2
npm ERR! error installing socket.io@0.9.8
npm ERR! error rolling back socket.io@0.9.8 Error: UNKNOWN, unknown error 'C:\apache\expTest\node_modules\node-inspector\node_modules\socket.io\node_modules\socket.io-client'
npm ERR! error installing node-inspector@0.2.0beta3

npm ERR! Error: ENOENT, no such file or directory 'C:\apache\expTest\node_modules\node-inspector\node_modules\socket.io\node_modules\socket.io-client\node_modules\___ws.npm\p
npm ERR! You may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>
npm ERR!
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "c:\\Program Files (x86)\\nodejs\\\\node.exe" "c:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-inspector"
npm ERR! cwd C:\apache\expTest
npm ERR! node -v v0.6.11
npm ERR! npm -v 1.1.1
npm ERR! path C:\apache\expTest\node_modules\node-inspector\node_modules\socket.io\node_modules\socket.io-client\node_modules\___ws.npm\package\lib\Validation.fallback.js
npm ERR! fstream_path C:\apache\expTest\node_modules\node-inspector\node_modules\socket.io\node_modules\socket.io-client\node_modules\___ws.npm\package\lib\Validation.fallbac
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! message ENOENT, no such file or directory 'C:\apache\expTest\node_modules\node-inspector\node_modules\socket.io\node_modules\socket.io-client\node_modules\___ws.npm\
npm ERR! errno {}
npm ERR! fstream_stack Object.oncomplete (c:\Program Files (x86)\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:204:26)
npm ERR! error rolling back node-inspector@0.2.0beta3 Error: UNKNOWN, unknown error 'C:\apache\expTest\node_modules\node-inspector\node_modules\socket.io\node_modules\socket.

npm ERR! hiredis@0.1.14 preinstall: `make || gmake`
npm ERR! `cmd "/c" "make || gmake"` failed with 1
npm ERR!
npm ERR! Failed at the hiredis@0.1.14 preinstall script.
npm ERR! This is most likely a problem with the hiredis package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     make || gmake
npm ERR! You can get their info via:
npm ERR!     npm owner ls hiredis
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "c:\\Program Files (x86)\\nodejs\\\\node.exe" "c:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-inspector"
npm ERR! cwd C:\apache\expTest
npm ERR! node -v v0.6.11
npm ERR! npm -v 1.1.1
npm ERR! code ELIFECYCLE
npm ERR! message hiredis@0.1.14 preinstall: `make || gmake`
npm ERR! message `cmd "/c" "make || gmake"` failed with 1
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\apache\expTest\npm-debug.log
npm not ok

看起来它正试图在hiredis 上运行nix 命令,但失败了,导致整个安装崩溃。有没有办法解决这个问题?我听说很多 Windows 用户使用 node-inspector,但也许这是对较新版本的依赖。有任何想法吗?

4

1 回答 1

1

正如 M. Laing 所说,您缺少 GNU make,这是hiredis(redis 连接器)所需的。

节点检查器不需要 redis,但 socket.io 需要它,即使它是一个完全可选的功能。我在 github 上打开了一个关于此的问题:

https://github.com/LearnBoost/socket.io/issues/978

虽然这个问题得到解决,但这里有一个解决方法:

  • 从github下载 socket.io 的 ZIP 存档并解压缩。
  • 编辑package.json文件并从依赖项中删除 redis。
  • 运行 cmd,进入文件夹并输入npm install.
  • 再次键入npm install node-inspector

由于现在已安装 socket.io,它现在应该成功了。

于 2012-08-05T23:48:00.483 回答