報錯如下圖: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