我刚刚开始使用node.js,当我尝试npm install
时,我收到一条错误,指出Failed at the bcrypt@0.8.5 install script 'node-gyp rebuild'
。经过广泛的谷歌搜索后,我仍然没有发现问题。
这里是错误日志:
313 verbose stack Error: bcrypt@0.8.5 install: `node-gyp rebuild`
313 verbose stack Exit status 1
313 verbose stack at EventEmitter.<anonymous> (C:\Users\Apparaat1\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:239:16)
313 verbose stack at emitTwo (events.js:100:13)
313 verbose stack at EventEmitter.emit (events.js:185:7)
313 verbose stack at ChildProcess.<anonymous> (C:\Users\Apparaat1\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:24:14)
313 verbose stack at emitTwo (events.js:100:13)
313 verbose stack at ChildProcess.emit (events.js:185:7)
313 verbose stack at maybeClose (internal/child_process.js:827:16)
313 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
314 verbose pkgid bcrypt@0.8.5
315 verbose cwd D:\Werk\W12C\we12c\W12C
316 error Windows_NT 6.1.7601
317 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Apparaat1\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
318 error node v5.7.0
319 error npm v3.7.3
320 error code ELIFECYCLE
321 error bcrypt@0.8.5 install: `node-gyp rebuild`
321 error Exit status 1
322 error Failed at the bcrypt@0.8.5 install script 'node-gyp rebuild'.
322 error Make sure you have the latest version of node.js and npm installed.
322 error If you do, this is most likely a problem with the bcrypt package,
322 error not with npm itself.
322 error Tell the author that this fails on your system:
322 error node-gyp rebuild
322 error You can get information on how to open an issue for this project with:
322 error npm bugs bcrypt
322 error Or if that isn't available, you can get their info via:
322 error npm owner ls bcrypt
322 error There is likely additional logging output above.
323 verbose exit [ 1, true ]
版本: 节点-v V5.7.0 npm -v 3.7.3
答案 0 :(得分:0)
可能是有点晚了但是节点gyp的解决方案 https://github.com/nodejs/node-gyp#installation 有2个 不同的选择。
选项1:使用Microsoft的windows-build-tools使用c:barChart
从提升的PowerShell或CMD.exe(以管理员身份运行)安装所有必需的工具和配置。
选项2:手动安装工具和配置:
Visual C ++构建环境:
选项1:使用默认安装选项安装Visual C++ Build Tools。
选项2:安装Visual Studio 2015(或修改现有安装)并在安装过程中选择 Visual C ++常用工具。这也适用于免费的社区和Express for Desktop版本。
安装Python 2.7(不支持npm install --global --production windows-build-tools
),并运行v3.x.x
(或有关指定正确的Python版本和路径的详细说明,请参阅下文。)
npm config set python python2.7
如果上述步骤不适合您,请访问Microsoft's Node.js Guidelines for Windows获取更多提示。
[仅限Windows Vista / 7]需要.NET Framework 4.5.1