npm 报错 ERR! as_c@0.1.0 serve: vue-cli-service serve

在这里插入图片描述

使用npm运行程序的时候,报错npm ERR! as_c@0.1.0 serve: vue-cli-service serve

>npm run serve

> as_c@0.1.0 serve
> vue-cli-service serve

'vue-cli-service' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! as_c@0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the as_c@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!     D:\Nodejs\node_cache\_logs\XXX-debug.log

解决方法:

1.删除node_modules文件夹。

2.使用国内镜像重新安装

npm install --registry=https://registry.npm.taobao.org

# 或
npm install -g cnpm --registry=https://registry.npm.taobao.org

cnpm install

3.重新运行

npm run serve
Logo

前往低代码交流专区

更多推荐