在Windows上安装节点检查器

当我运行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命令,失败,崩溃整个安装。 有什么办法可以解决这个问题吗? 我听到很多使用node-inspector的Windows用户,但也许这是来自较新版本的依赖。 有任何想法吗?

正如M. Laing所说,你错过了hiredis(redis连接器)所需的GNU make。

您不需要节点检查器的redis,但它是socket.io所需的,即使它是一个完全可选的function。 我已经在github上提出了一个问题:

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

虽然这得到解决,这是一个解决方法:

  • 从github下载socket.io的ZIP压缩文件并解压缩。
  • 编辑package.json文件并从依赖关系中删除redis。
  • 运行一个cmd,input文件夹并inputnpm install
  • 再次键入npm install node-inspector

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