标签

Honeymoon - Thomas Ng

归档

近期文章

解决 This is probably not a problem with npm. There is likely additional logging output above.

解决 This is probably not a problem with npm. There is likely additional logging output above.

在执行 npm run serve 运行项目的时候报错:

dengzemiaodeMacBook-Pro:lianshan_vue dengzemiao$ npm run serve

......

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lianshan@2.0.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the lianshan@2.0.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/dengzemiao/.npm/_logs/2021-01-14T06_10_01_084Z-debug.log

如果出现这种报错情况,需要重新安装 node_modules 文件夹中的内容 但是在安装前,要把之前的内容都清空掉。

其实大多数的主要问题是 package-lock.json 这个文件,一般使用 1、2、4 步就够了,如果不行在重新 1、2、3、4 步,因为使用了 第3步,在 $ npm install 安装会要点时间,相对较慢。

步骤如下:

1、首先删除 node_modules,可以命令行删除,也可以手动右键删除文件夹。

$ rmdir /s/q node_modules

2、删除 package-lock.json 文件

3、运行命令

$ npm cache clean --force

4、重新加载 $ npm install

Buy me a cup of coffee 🙂

​ 觉得对你有帮助,就给我打赏吧,谢谢! ​ 微信赞赏码链接,点击跳转:

解决 This is probably not a problem with npm. There is likely additional logging output above.插图
Tags: