安装帆时出现以下错误

> [email protected] preinstall E:\jb\npmtest\node_modules\sails
> node ./lib/preinstall_npmcheck.js

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\nodejs\\\\node.exe" "C:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "sails"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! file C:\Windows\system32\cmd.exe;
npm ERR! path C:\Windows\system32\cmd.exe;
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn C:\Windows\system32\cmd.exe;

npm ERR! [email protected] preinstall: `node ./lib/preinstall_npmcheck.js`
npm ERR! spawn C:\Windows\system32\cmd.exe; ENOENT
npm ERR!
npm ERR! Failed at the [email protected] preinstall script 'node ./lib/preinstall_npmcheck.js'.
npm ERR! This is most likely a problem with the sails package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./lib/preinstall_npmcheck.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls sails
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     E:\jb\npmtest\npm-debug.log


我试图使帆起航为0.10,但出现此错误

npm WARN deprecated [email protected]: DEPRECATED. See readme: https://github.com/gruntjs/grunt-lib-contrib
\


> [email protected] install E:\jb\npmtest\node_modules\sails\node_modules\socket.io\node_modules\socket.io-client\node_modules\ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\nodejs\\\\node.exe" "C:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "[email protected]"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! file C:\Windows\system32\cmd.exe;
npm ERR! path C:\Windows\system32\cmd.exe;
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn C:\Windows\system32\cmd.exe;

npm ERR! [email protected] install: `(node-gyp rebuild 2> builderror.log) || (exit 0)`
npm ERR! spawn C:\Windows\system32\cmd.exe; ENOENT
npm ERR!
npm ERR! Failed at the [email protected] install script '(node-gyp rebuild 2> builderror.log) || (exit 0)'.
npm ERR! This is most likely a problem with the ws package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     (node-gyp rebuild 2> builderror.log) || (exit 0)
npm ERR! You can get their info via:
npm ERR!     npm owner ls ws
npm ERR! There is likely additional logging output above.


我已尝试通过尝试此链接https://github.com/balderdashy/sails/issues/2751建议的npm cache clear来解决此错误。但是我仍然遇到错误。

最佳答案

我已经通过运行命令npm install -g sails --ignore-scripts解决了这个问题

关于node.js - 在Windows 7中安装Sails时出错,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30252935/

10-16 17:13