首页 > 解决方案 > 尝试在 Windows 上构建项目时 npm install 失败

问题描述

我正在尝试在 Windows 上构建一个项目,但我一直遇到此错误消息,并且我有大部分可以在网上找到的修复程序。我已将 strict-ssl false 添加到我的配置中,但没有帮助。我尝试关闭/打开代理并完全删除了我的代理配置。任何帮助将不胜感激

[INFO] Found proxies: [http{protocol='http', host='127.0.0.1', port=9443, with username/passport authentication}]
[INFO] Running 'npm install --proxy=http://username:password@127.0.0.1:9443' in C:\dev\repo
[ERROR] npm ERR! code EPROTO
[ERROR] npm ERR! errno EPROTO
[ERROR] npm ERR! request to https://registry.npmjs.org/dompurify failed, reason: write EPROTO 101057795:error:1408D07B:SSL routines:ssl3_get_key_exchange:bad signature:openssl\ssl\s3_clnt.c:2010:
[ERROR] npm ERR!
[ERROR]
[ERROR] npm ERR! A complete log of this run can be found in:
[ERROR] npm ERR!     C:\Users\user\AppData\Roaming\npm-cache\_logs\2021-09-07T20_04_20_498Z-debug.log

从此错误日志中:

17 silly fetchPackageMetaData error for dompurify@^2.2.8 request to https://registry.npmjs.org/dompurify failed, reason: write EPROTO 101057795:error:1408D07B:SSL routines:ssl3_get_key_exchange:bad signature:openssl\ssl\s3_clnt.c:2010:
18 silly fetchPackageMetaData error for dompurify@^2.2.8 request to https://registry.npmjs.org/dompurify failed, reason: write EPROTO 101057795:error:1408D07B:SSL routines:ssl3_get_key_exchange:bad signature:openssl\ssl\s3_clnt.c:2010:
22 verbose type system
23 verbose stack FetchError: request to https://registry.npmjs.org/dompurify failed, reason: write EPROTO 101057795:error:1408D07B:SSL routines:ssl3_get_key_exchange:bad signature:openssl\ssl\s3_clnt.c:2010:
23 verbose stack
23 verbose stack     at ClientRequest.req.on.err (C:\dev\repo\webapp\node\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14)
23 verbose stack     at emitOne (events.js:96:13)
23 verbose stack     at ClientRequest.emit (events.js:188:7)
23 verbose stack     at TLSSocket.socketErrorListener (_http_client.js:310:9)
23 verbose stack     at emitOne (events.js:96:13)
23 verbose stack     at TLSSocket.emit (events.js:188:7)
23 verbose stack     at onwriteError (_stream_writable.js:345:10)
23 verbose stack     at onwrite (_stream_writable.js:363:5)
23 verbose stack     at WritableState.onwrite (_stream_writable.js:89:5)
23 verbose stack     at fireErrorCallbacks (net.js:468:13)
23 verbose stack     at TLSSocket.Socket._destroy (net.js:509:3)
23 verbose stack     at WriteWrap.afterWrite (net.js:801:10)
24 verbose cwd C:\dev\repo\webapp
25 verbose Windows_NT 10.0.19043
26 verbose argv "C:\\dev\\repo\\webapp\\node\\node.exe" "C:\\dev\\repo\\webapp\\node\\node_modules\\npm\\bin\\npm-cli.js" "install" "--proxy=http://username:password@127.0.0.1:9443"
27 verbose node v6.9.0
28 verbose npm  v6.10.0
29 error code EPROTO
30 error errno EPROTO
31 error request to https://registry.npmjs.org/dompurify failed, reason: write EPROTO 101057795:error:1408D07B:SSL routines:ssl3_get_key_exchange:bad signature:openssl\ssl\s3_clnt.c:2010:
32 verbose exit [ 1, true ]

标签: node.jssslnpm

解决方案


推荐阅读