【发布时间】: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