‘vue-cli-service‘ 不是内部或外部命令,也不是可运行的程序 或批处理文件

vue时,报’vue-cli-service’ 不是内部或外部命令,也不是可运行的程序 或批处理文件。罪该万死,怎么能忘记 npm install,如果你下载的淘宝镜像,也可以cnpm install。
‘vue-cli-service‘ 不是内部或外部命令,也不是可运行的程序 或批处理文件
文章图片

转载于:https://www.cnblogs.com/hellohero55/p/11162197.html

1.检查的时候看package.json里面有没有 vue-cli-service;
2.有则删除 node modules; 重新安装 node modules;
3.没有 则 单独安装 vue-cli-service;yarn add vue-cli-service -S
vue-cli-service 并没有加入到环境变量里。可以进入到项目中,用命令 ./node_modules/.bin/vue-cli-service 执行
使用nrm源管理器,切换成淘宝的源:
nrm常用命令

  • 安装 cnpm i -g nrm
  • 查看 版本 nrm --version
  • 查看源列表(带 *号是正在使用的) nrm ls
  • 切换使用源 nrm use taobao
  • 测试源速度 nrm test taobao
  • 测试源速度(所有) nrm test
  • 使用一个包使用特定源 npm i logo --registry=https://registry.npm.taobao.org
  • 删除源 nrm del taobao
npm uninstall vue-cli -g 卸载旧版本
【‘vue-cli-service‘ 不是内部或外部命令,也不是可运行的程序 或批处理文件】

    推荐阅读