mac 報錯:sh: vue-cli-service: command not found

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章