node_modules/.bin/vue-cli-service: アクセス許可が拒否されました

背景

一部のフロントエンド依存ライブラリはプライベート サーバーであり、ローカル エリア ネットワークでのみダウンロードできるためです。したがって、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