node_modules/.bin/vue-cli-service: Permission denied

背景

因为有一些前端依赖的库是私服的,只有在局域网中才能下载到。所以我直接把node_modules复制过来直接使用的。我是从windows系统中复制到macOS中使用。

现象

npm run serve

> [email protected] serve /Users/itkey/workspace/frontend
> vue-cli-service serve

sh: /Users/itkey/workspace/node_modules/.bin/vue-cli-service: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! [email protected] serve: `vue-cli-service serve`
npm ERR! Exit status 126
npm ERR! 
npm ERR! Failed at the [email protected] serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

解决办法

通过上面可以看出来,应该是没有可执行权限导致的。

chmod +x /Users/itkey/workspace/frontend/node_modules/.bin/vue-cli-service

问题得到解决。

猜你喜欢

转载自blog.csdn.net/lxyoucan/article/details/132987008