【问题标题】:npm install fails with bad signature error on Windowsnpm install 在 Windows 上因签名错误而失败
【发布时间】:2020-09-22 12:10:24
【问题描述】:

我正在使用 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


    【解决方案1】:

    免责声明对 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 请求对其进行测试。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-10-24
      • 2020-06-04
      • 1970-01-01
      • 2022-01-15
      • 2015-03-30
      • 1970-01-01
      • 2014-03-20
      相关资源
      最近更新 更多