npm - 报错:found XXX vulnerabilities (XXX low, X moderate),run `npm audit fix` to fix them, or `npm au

完整报错

我正准备 npm 装包,结果失败了,并提示如下报错信息:

found 808 vulnerabilities (804 low, 4 moderate)
  run `npm audit fix` to fix them, or `npm audit` for details

解决

直接按照后面提示的命令执行:

npm audit fix

紧接着会报错,继续输入以下命令 清除缓存

npm cache clean --force

如果到了这里你依然没解决,那么就是 缺少 package.json 文件问题!

再次解决

直接在你项目根目录,执行如下命令:

npm init -y

你会发现项目多了一个 package.json 文件,这时你再装包试试!

猜你喜欢

转载自blog.csdn.net/weixin_44198965/article/details/107491382