安装依赖报错

安装依赖报错

$ npm install

npm WARN deprecated bcrypt@3.0.8: versions < v5.0.0 do not handle NUL in passwords properly


> bcrypt@3.0.8 install D:\my-project\big-front\ten\toimc-api\node_modules\bcrypt

> node-pre-gyp install --fallback-to-build


node-pre-gyp WARN Using needle for node-pre-gyp https download

node-pre-gyp WARN Pre-built binaries not installable for bcrypt@3.0.8 and node@12.16.3 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)

node-pre-gyp WARN Hit error unable to verify the first certificate

gyp WARN install got an error, rolling back install

gyp ERR! configure error

gyp ERR! stack Error: unable to verify the first certificate

gyp ERR! stack     at TLSSocket.onConnectSecure (_tls_wrap.js:1474:34)

gyp ERR! stack     at TLSSocket.emit (events.js:310:20)

gyp ERR! stack     at TLSSocket._finishInit (_tls_wrap.js:917:8)

gyp ERR! stack     at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:687:12)

gyp ERR! System Windows_NT 10.0.18363

gyp ERR! command "D:\\office\\node.exe" "D:\\office\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=D:\\my-project\\big-front\\ten\\toimc-api\\node_modules\\bcrypt\\lib\\binding\\bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=D:\\my-project\\big-front\\ten\\toimc-api\\node_modules\\bcrypt\\lib\\binding" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72" "--python=C:\\Users\\Administrator\\.windows-build-tools\\python27\\python.exe"

gyp ERR! cwd D:\my-project\big-front\ten\toimc-api\node_modules\bcrypt

gyp ERR! node -v v12.16.3

gyp ERR! node-gyp -v v5.1.0

gyp ERR! not ok

node-pre-gyp ERR! build error

node-pre-gyp ERR! stack Error: Failed to execute 'D:\office\node.exe D:\office\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=D:\my-project\big-front\ten\toimc-api\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=D:\my-project\big-front\ten\toimc-api\node_modules\bcrypt\lib\binding --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72 --python=C:\Users\Administrator\.windows-build-tools\python27\python.exe' (1)

node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (D:\my-project\big-front\ten\toimc-api\node_modules\node-pre-gyp\lib\util\compile.js:83:29)

node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:310:20)

node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)

node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)

node-pre-gyp ERR! System Windows_NT 10.0.18363

node-pre-gyp ERR! command "D:\\office\\node.exe" "D:\\my-project\\big-front\\ten\\toimc-api\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"

node-pre-gyp ERR! cwd D:\my-project\big-front\ten\toimc-api\node_modules\bcrypt

node-pre-gyp ERR! node -v v12.16.3

node-pre-gyp ERR! node-pre-gyp -v v0.14.0

node-pre-gyp ERR! not ok

Failed to execute 'D:\office\node.exe D:\office\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=D:\my-project\big-front\ten\toimc-api\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=D:\my-project\big-front\ten\toimc-api\node_modules\bcrypt\lib\binding --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72 --python=C:\Users\Administrator\.windows-build-tools\python27\python.exe' (1)

npm WARN api@1.0.0 No description

npm WARN api@1.0.0 No repository field.

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules\watchpack\node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})


npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! bcrypt@3.0.8 install: `node-pre-gyp install --fallback-to-build`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the bcrypt@3.0.8 install script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


npm ERR! A complete log of this run can be found in:

npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-08-03T13_56_40_586Z-debug.log


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
Brian 2020-08-04 21:42:52

bcrypt@3.0.8 这个包的安装非常依赖环境,

http://img1.sycdn.imooc.com//climg/5f2965be099b746d11280860.jpg

实在安装不成功,可以使用这个包:https://www.npmjs.com/package/crypto-js


  • 提问者 全粘攻城狮 #1
    明白了,其实已经选择用了"bcryptjs": "^2.4.3",但是bcrypt@3.0.8这个包在配置里面一直没有删除,所以一直报这个错。
    2020-08-04 22:04:35
  • Brian 回复 提问者 全粘攻城狮 #2
    s可以手动删除
    2020-08-29 00:43:46
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师