【问题解决】npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] serve: `vue-cli-service serv

Plan

在本地运行ids项目.

Do

执行npm run serve,报如下错误

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

直接百度之后找到解决方案:Vue错误跳坑
在这里插入图片描述
跟着文章中提示的解决方法,运行后报如下错误:

在这里插入图片描述
在这里插入图片描述
百度解决说要改代码,所以就请教了导师,导师说我操作有误,先把项目给回滚了,并进到项目中用命令行删除了node_modules文件夹
在这里插入图片描述
之后,cmd 执行npm install,发现执行到loadIdealTree:loadAllDepsIntoIdealTree: sill install loadIdealTree界面一直不动,百度答案为
在这里插入图片描述
这和第一次的解决方法没啥区别,所以又请教了导师,导师去idea中执行了npm install,发现居然可以顺畅的执行下去了。。。
在这里插入图片描述
接着去vscode再次运行代码,接着报错

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ids@1.0.0 serve: `vue-cli-service serve --open`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ids@1.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!     C:\Users\UIDQ5637\AppData\Roaming\npm-cache\_logs\2022-11-03T03_20_04_771Z-debug.log

又执行:npm install vue-cli-service,接着报错

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/vue-cli-service - Not found
npm ERR! 404
npm ERR! 404  'vue-cli-service@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\UIDQ5637\AppData\Roaming\npm-cache\_logs\2022-11-03T03_21_10_296Z-debug.log

最后执行 npm install --save,就可以成功运行了
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/someday____/article/details/127667270