这两天使用npm一直出现这个错误,当时没有在意,后来发现报的错误越来越多,如下:

1
2
3
4
found 658 vulnerabilities (654 low, 3 moderate, 1 high) in 2770 scanned packages
run `npm audit fix` to fix 1 of them.
4 vulnerabilities require semver-major dependency updates.
653 vulnerabilities require manual review. See the full report for details.

根据上面的提示输入npm audit fix,还是没有解决,报的错误如下:

1
2
3
fixed 5 of 658 vulnerabilities in 2770 scanned packages
653 vulnerabilities required manual review and could not be updated
1 package update for 4 vulnerabilities involved breaking changes

网上找了好久,都没有解决,后来看到一篇博客解决。解决方法如下:

  1. 淘宝镜像源会自动修复,然后下载相关依赖包。
  2. 使用nrm use taobao,nrm如果没有安装,就使用npm i -g nrm,然后再使用nrm use taobao
  3. 再使用npm i 安装一遍所有依赖包,这时候没下载的会自动下载,问题解决。