在终端输入 npm run dev 时报错 npm ERR! code ELIFECYCLE

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! code@1.0.0 script: `babel js -d scripts`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the code@1.0.0 script script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?        

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\rookieding\AppData\Roaming\npm-cache\_logs\2021-01-10T16_24_19_912Z-debug.log

错误原因在于由于文件 node_modules 太大,在项目上传时有些人会删掉

导致我们下载的项目中缺少这个文件

解决方法:在命令行中先进入文件所在路径

然后输入命令

npm i

在启动时就成功了

猜你喜欢

转载自blog.csdn.net/CS_DGD/article/details/112455495