npm 在 Windows 上安装失败并出现错误签名错误

问题描述 投票:0回答:3

我正在使用 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 添加到我的配置中,但这没有帮助。我没有在代理后面,我在我的公司防火墙、家庭网络甚至我的移动热点后面尝试过它,都出现相同的错误。我更改为使用 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:
node.js npm openssl npm-install
3个回答
1
投票

免责声明对 Nodejs 没有那么丰富的经验,我给出的答案是我自己对这个问题的研究,希望能在某种程度上帮助你。

参考资料: write-eproto-101057795...通用代理和网络连接...

首先检查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 请求来测试它。

0
投票

来自您的错误日志

...
...
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/

0
投票

我通过使用更高版本的节点得到了解决 就像之前我使用 6.9.0 现在我切换到 12.14.1

nvm list

© www.soinside.com 2019 - 2024. All rights reserved.