npm ERR! This is probably not a problem with npm.
文章目录
fix:npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
在项目中安装新依赖包或者更新升级依赖包的时候,有时候突然会出现报错:
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
遇到这种情况,通常是出现丢失依赖、或者新的包安装文件冲突导致。
解决办法是需要首先删除node_modules文件夹及下面的所有内容,注意这个时候先停止项目,关掉浏览器的项目,不然可能删除不干净,然后重新buiid。
具体解决流程如下:
- 1、首先关掉浏览器运行的项目,删除
node_modules文件夹。 - 2、删除
package-lock.json文件 - 3、执行命令:
npm cache clean --force - 4、重新build:
yarn或者npm install或者cnpm install
正常这几个步骤下来即可解决!
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论