Macos下執行npm打包vue報錯

問題描述

victorwk@localhost vue-ui % npm run build

> [email protected] build /Volumes/victor/java_about/xxx-vue
> vue-cli-service build

sh: /Volumes/victor/java_about/xxx/node_modules/.bin/vue-cli-service: /bin/sh: bad interpreter: Operation not permitted
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! [email protected] build: `vue-cli-service build`
npm ERR! Exit status 126
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/wangkang/.npm/_logs/2020-03-27T07_13_52_132Z-debug.log

執行命令解決

到項目路徑下
rm -rf node_modules
rm package-lock.json
npm cache clear --force
在執行
npm install
成功執行
npm run build
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章