npm 报错 426 Upgrade Required

39 篇文章 2 订阅
7 篇文章 0 订阅
本文指导如何修复在尝试发布npm包或登录时遇到的ERR! 426 UpgradeRequired问题,需将Node.js升级至14.18.0及以上,并同步更新npm到最新版本,同时确保使用HTTPS连接npm registry。
摘要由CSDN通过智能技术生成

ERR! 426 Upgrade Required

解决方法

更新 node 版本到 14.18.0 以上,可以参考:https://www.jianshu.com/p/e6d3f7110a60

然后升级 npm 的版本到最新

npm install -g npm@latest
npm config set registry https://registry.npmjs.org/

下面是详细的英文描述及原因

When I try to publish a new package to npm or try to logout, I get the following error message:

npm ERR! code E426
npm ERR! 426 Upgrade Required

在这里插入图片描述

原因:2021年10月4日后,npm 网站和 npm registry 必须使用 TLS 安全套接层 1.2 版本,所以需要升级对应版本

Beginning October 4, 2021, all connections to npm websites and the npm registry—including for package installation—must use TLS 1.2 or higher.

Source

What I did:

  • upgrade Node (0) to its current recommended version: 14.18.0 LTS
  • upgrade npm with npm install -g npm@latest

In my case, I had to manually set the registry to use https instead of http as well:

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

(0) When using nvm, that’s what you need to do:

nvm install 14.18.0
nvm use 14.18.0
nvm alias default 14.18.0

参考链接

https://stackoverflow.com/questions/69448082/err-426-upgrade-required-when-i-interact-with-the-npm-registry

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值