报错如下:sh: vue-cli-service: command not found
清除缓冲
npm cache clean --force
重新安装
npm/cnpm install
另网上的文章,大致说了3个解决方法
1、重新安装
将 文件夹node_modules
删除在执行 npm/cnpm install
进行重新安装
2、指定路径
./node_modules/.bin/vue-cli-service build
3、全局安装
npm install @vue/cli-service -g
4、环境变量NODE_ENV=production
多试几次,如果别的原因可以参考 https://stackoverflow.com/questions/51172064/command-not-found-with-vue-cli
tips:
我这次是直接全局执行安装:
npm install @vue/cli-service -g
,然后就解决报错了
网友评论