簡體   English   中英

npm 安裝失敗,在 Windows 上出現錯誤的簽名錯誤

[英]npm install fails with bad signature error on Windows

我正在使用 nvm 來管理我的節點版本。 我有一個用戶節點 6.10.2 的項目。 使用像npm install -g gulp這樣簡單的東西,我得到以下錯誤:

write EPROTO 101057795:error:1408D07B:SSL routines:ssl3_get_key_exchange:bad signature:openssl\ssl\s3_clnt.c:20

我已將 strict-ssl false 添加到我的配置中,但沒有幫助。 我不在代理后面,我已經在我的公司防火牆、home.network 甚至我的移動熱點后面嘗試過,都出現了同樣的錯誤。 我更改為使用 http:// 而不是 https:// 使用npm config set registry http://registry.npmjs.org/這讓我過去了 gulp 錯誤但隨后與其他包錯誤返回(大概是因為他們拉來自不同的注冊表)。 無論如何,使用 http:// 讓我擔心安全問題。

我在節點 6.10.2 和 7.4.0 上得到了相同的結果。 如果我跳轉到最新的節點,12.18.0 不會發生錯誤,但我正在處理的項目不支持新的節點版本。 不知道還能嘗試什么。

這是 npm-debug.log 文件的錯誤部分:

103 verbose stack Error: write EPROTO 101057795:error:1408D07B:SSL routines:ssl3_get_key_exchange:bad signature:openssl\ssl\s3_clnt.c:2032:
103 verbose stack
103 verbose stack     at exports._errnoException (util.js:1018:11)
103 verbose stack     at WriteWrap.afterWrite (net.js:804:14)
104 verbose cwd C:\code\extraspace.web.pointofsale
105 error Windows_NT 10.0.18363
106 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "gulp"
107 error node v6.10.2
108 error npm  v3.10.10
109 error code EPROTO
110 error errno EPROTO
111 error syscall write
112 error write EPROTO 101057795:error:1408D07B:SSL routines:ssl3_get_key_exchange:bad signature:openssl\ssl\s3_clnt.c:2032:

@sledguy,當我將 bower install 命令放入 cmd 時,我遇到了類似的異常,為了解決它,我在 .bowerrc 文件中添加了 { "registry": "https://registry.bower.io"} ,仍然發生同樣的錯誤, and after changing the https://registry.bower.io to http://registry.bower.io , the error was solved.

免責聲明Nodejs 經驗不足,我給出的答案是我自己對這個問題的研究,希望能在某種程度上幫助你。

參考: write-eproto-101057795...common-proxy-and-networking-p...

首先檢查Nodejs是否正確安裝

- Open Command Prompt (Windows) or Terminal (Mac) or Bash (Linux)
- Execute this command: node -v (The output should be "6.10.2")
- Execute this command: npm -v (The output should be "(some-version)")

嘗試這個:

- Open Command Prompt (Windows) or Terminal (Mac) or Bash (Linux)
- Go to the "app" folder (Located on the same folder of this file)
- Execute this command (*): npm install --development
- Execute this command: npm start --development

如果以上所有方法都失敗了,請檢查下面的列表。

  1. 確保您有可用的互聯網連接。 你能到達https://registry.npmjs.org嗎? 你能到達其他網站嗎? 如果其他站點無法訪問,這不是 npm 的問題。
  2. 檢查http://status.npmjs.org/是否存在任何潛在的當前服務中斷。
  3. 如果您的公司有針對開發人員的域白名單流程,請確保https://registry.npmjs.org是列入白名單的域。
  4. 如果您在中國,請考慮使用https://npm.taobao.org/作為位於防火牆后面的注冊表。
  5. 在 Windows 上,npm 不訪問在系統級別配置的代理,因此您需要手動配置它們以便 npm 訪問它們。 確保您已將適當的代理配置添加到 .npmrc。
  6. 如果您已經配置了代理,則它可能配置不正確或使用了錯誤的憑據。 驗證您的憑據,使用單獨的應用程序測試特定憑據。
  7. 服務器上的代理本身也可能存在配置錯誤。 在這種情況下,您需要與系統管理員一起驗證代理和 HTTPS 是否配置正確。 您可以通過運行常規 HTTPS 請求來測試它。

從你的錯誤日志

...
...
107 error node v6.10.2
108 error npm  v3.10.10
...
...

您的 npm 和 nodejs 版本很舊。 嘗試升級 npm 和 nodejs 版本。

也試試

//disable strict ssl checking
npm config set strict-ssl false
//if you're using different npm registry try official registry for debug
npm config set registry https://registry.npmjs.org/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM