npm login 提示must use TLS 1.2 or higher

近期想把npm 库发布出去,很久没登录了,npm login时提示:

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/

根据提示打开 https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/

npm install -g https://tls-test.npmjs.com/tls-test-1.0.0.tgz

结果还是提示

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

网上查了些资料 说要设置

npm config set registry http://registry.npmjs.org/

还是不行,我都是最新版本的 npm (V8)了

npm config set registry=https://registry.npmjs.org

registry 也要设置成https的

你可能感兴趣的:(npm login 提示must use TLS 1.2 or higher)