centos npm run build 报错

报错信息

npm run  build 
> [email protected] build /home/lvph/work/XXXX
> vue-cli-service build

sh: XXXX/node_modules/.bin/vue-cli-service: Permission denied
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!     /home/lvph/.npm/_logs/2020-01-19T01_33_20_803Z-debug.log

解决办法

到项目路径下
rm -rf node_modules
rm package-lock.json
npm cache clear --force
在执行
npm install

最后成功

npm run build

猜你喜欢

转载自www.cnblogs.com/lph970417/p/12212507.html