【发布时间】:2016-10-02 10:04:22
【问题描述】:
我正在阅读 HAPI js 教程身份验证部分 (http://hapijs.com/tutorials/auth?lang=en_US),它需要“bcrypt”。所以我做了“npm install bcrypt --save”。但这会导致 node-gyp 错误,例如缺少 php。所以我按照这里给出的说明进行操作: https://github.com/nodejs/node-gyp#installation
我什至做了:npm install --global --production windows-build-tools
但现在它抛出错误:
“CL.exe”以代码-1073741511退出
我已经安装了他们要求的所有东西,但它不允许安装 bcrypt。我该怎么办?
由于简单的教程练习花了我 2 天的时间研究,但没有任何解决方案。为什么在你的教程中使用这种依赖驱动的包?
这是我正在执行 npm install bcrypt 的实际控制台日志:
m WARN package.json personal_assistant@1.0.0 No README data
bcrypt@0.8.7 install D:\learn\personal_assistant\server\node_modules\bcrypt
node-gyp rebuild
\learn\personal_assistant\server\node_modules\bcrypt>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\
\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
ilding the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
\Program Files\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(356,5): error MSB6006: "CL.exe" exited with code -1073741511. [D:\learn\personal_
sistant\server\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
p ERR! build error
p ERR! stack Error: `C:\Program Files\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
p ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
p ERR! stack at emitTwo (events.js:87:13)
p ERR! stack at ChildProcess.emit (events.js:172:7)
p ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
p ERR! System Windows_NT 6.1.7600
p ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
p ERR! cwd D:\learn\personal_assistant\server\node_modules\bcrypt
p ERR! node -v v4.5.0
p ERR! node-gyp -v v3.4.0
p ERR! not ok
m ERR! Windows_NT 6.1.7600
m ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "bcrypt" "--save"
m ERR! node v4.5.0
m ERR! npm v2.15.9
m ERR! code ELIFECYCLE
m ERR! bcrypt@0.8.7 install: `node-gyp rebuild`
m ERR! Exit status 1
m ERR!
m ERR! Failed at the bcrypt@0.8.7 install script 'node-gyp rebuild'.
m ERR! This is most likely a problem with the bcrypt package,
m ERR! not with npm itself.
m ERR! Tell the author that this fails on your system:
m ERR! node-gyp rebuild
m ERR! You can get information on how to open an issue for this project with:
m ERR! npm bugs bcrypt
m ERR! Or if that isn't available, you can get their info via:
m ERR!
m ERR! npm owner ls bcrypt
m ERR! There is likely additional logging output above.
m ERR! Please include the following file with any support request:
m ERR! D:\learn\personal_assistant\server\npm-debug.log
【问题讨论】:
标签: node.js npm bcrypt hapijs node-gyp