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 ERR! code E426
npm ERR! 426 Upgrade Required - PUT http://registry.npmjs.org/winkcli-main
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\10177\AppData\Roaming\npm-cache\_logs\2022-04-07T17_23_17_083Z-debug.log
网上查了下
解决方式:更新版本
npm install -g npm
or
npm update npm
命令时报错
npm ERR! code EEXIST
npm ERR! path C:\Program Files\nodejs\npm.cmd
npm ERR! Refusing to delete C:\Program Files\nodejs\npm.cmd: is outside C:\Program Files\nodejs\node_modules\npm and not a link
npm ERR! File exists: C:\Program Files\nodejs\npm.cmd
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\10177\AppData\Roaming\npm-cache\_logs\2022-04-07T17_29_59_030Z-debug.log
改用npm install -g --force npm 仍报错
1.将npm镜像地址设为https的地址
npm config set registry https://registry.npmjs.org
2.运行以下命令支持TLS 1.2:
npm install -g https://tls-test.npmjs.com/tls-test-1.0.0.tgz
解决问题,发布成功
参考文章:
(52条消息) npm publish 时提示需要升级TLS 1.2的解决方案_Ricky__H的博客-CSDN博客_npm tls
其他文章:
学习用ts+gulp+rollup写一个工具库 - 掘金 (juejin.cn)
|