【npm】npm6升7以及426解决方式

前言

  • 最近发包时发现npm报错:The npm registry is deprecating TLS 1.0 and TLS 1.1
  • 原来以前一直用npm6发包,最低支持到10月4日,以下原文:

Detailed timeline

While we will enforce a minimum of TLS 1.2 beginning October 4, 2021, we will also take steps to alert affected users to this change ahead of the deprecation.

Beginning on August 24, users who are not using TLS 1.2 will see a notification when they run npm commands with a link to this blog post.
On September 22, we will enforce TLS 1.2 for one hour starting at 05:00 UTC.

On September 27, we will enforce TLS 1.2 for one hour starting at 10:00 UTC and again for one hour at 18:00 UTC.

Finally, on September 29, we will enforce TLS 1.2 for six hours beginning at 13:00 UTC.

确保兼容性

  • 需要运行命令:
npm install -g https://tls-test.npmjs.com/tls-test-1.0.0.tgz
  • 如果提示:
Hello! The tls-test package was successfully downloaded and installed.

Congratulations! Your package manager appears to support TLS 1.2.
  • 说明不用升node,否则node版本也要升级。
  • 然后去升级npm7。

升级npm7

  • 使用命令:
npm install --global npm
  • 中间有可能报错,需要手动删除几个文件。
  • 之后运行npm version即可看见升级成功:
{
  npm: '7.24.2',
  node: '14.15.4',
  v8: '8.4.371.19-node.17',
  uv: '1.40.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.16.1',
  modules: '83',
  nghttp2: '1.41.0',
  napi: '7',
  llhttp: '2.1.3',
  openssl: '1.1.1i',
  cldr: '37.0',
  icu: '67.1',
  tz: '2020a',
  unicode: '13.0'
}

npm7新特性

  • 原文:https://github.blog/2021-02-02-npm-7-is-now-generally-available/

426报错

  • 注意! http协议10月4日已经被禁止,需要修改默认npm仓库为https而不是http。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

业火之理

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值