【问题标题】:Getting npm errors due to outdated TLS: "tls-test" isn't working由于过时的 TLS 出现 npm 错误:\"tls-test\" 不工作
【发布时间】:2023-01-27 05:03:47
【问题描述】:

在我的 JavaScript VS Code 项目上运行 npm i 时,我一直收到此消息:

npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/

似乎适用于很多人的解决方案是更新 Windows 10,然后运行以下命令:

npm set registry=https://registry.npmjs.org/
npm install -g https://tls-test.npmjs.com/tls-test-1.0.0.tgz

所以我就那样做了。上面的第二个命令(带有 tls-test 的命令)如果有效的话应该给我这个响应:

Hello! The tls-test package was successfully downloaded and installed.
Congratulations! Your package manager appears to support TLS 1.2.

相反,我得到这个:

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

changed 1 package in 827ms

似乎安装没有错误,但仍然没有给我正确的消息。我假设这意味着我的 TLS 仍未启用,那么我在这里缺少什么?

在此先感谢您的帮助!

【问题讨论】:

  • 什么版本的 npm 和 node.js?
  • 我正在使用最新的节点和 npm: "node": "16.16.0", "npm": "9.1.3"

标签: node.js windows ssl npm tls1.2


【解决方案1】:
猜你喜欢
  • 2019-05-06
  • 1970-01-01
  • 1970-01-01
  • 2020-10-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-08-02
  • 1970-01-01
相关资源
最近更新 更多