npm run serve 报错了 该如何解决,老项目npm run serve 后就报错了
建议 使用 mpm 下载 或者修改 源 为淘宝源
npm config set registry https://registry.npm.taobao.org
npm run serve 报错,不排除是你的依赖丢包了
重新安装下node_modules试一下
你现在截图是yarn下载不下来,
可以参考楼上用镜像源
或者有cnpm 用cnpm装yarn也可以
npm run serve 运行中最常遇到的问题
在运行命令时ERR报错了,问题是路径不对
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path F:\VUE项目\xinguan\package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open ‘F:\VUE项目\xinguan\package.json’
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Program Files\nodejs\node_cache_logs\2020-12-24T08_33_26_581Z-debug.log
解决方法:
路径不对,所以我们要进入存vue项目的子文件夹cd cd 文件夹
可以打开子文件夹
cd xinguan-vue后,继续运行npm run serve
结果运行成功了
注意:一定要进到存vue的子文件夹里执行
npm run serve命令。