在运行vue文件的时候报错——“‘vue-cli-service‘ 不是内部或外部命令,也不是可运行的程序 或批处理文件。”的解决方法

报错内容如下:
‘vue-cli-service’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mas-creator-admin@0.1.0 serve: vue-cli-service serve
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mas-creator-admin@0.1.0 serve 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\pingfan_yu\AppData\Roaming\npm-cache_logs\2024-10-13T11_49_06_100Z-debug.log
E:\BaiduNetdiskDownload\springbooti5zlnm7v\src\main\resources\admin\admin>Remove-item -Force -Recurse node_modules
‘Remove-item’ 不是内部或外部命令,也不是可运行的程序或批处理文件。
先安装一下rimraf
npm install rimraf -g

然后删除node_modules
rimraf node_modules
然后在用淘宝镜像重新安装
npm install --registry=https://registry.npm.taobao.org

最后重新运行项目就能出来
npm run serve

更多推荐



所有评论(0)