一、問題描述:vue啓動 npm run dev 報錯 Error: Cannot find module webpack
bogon:marking-vue bc$ sudo npm run dev
Password:
> [email protected] dev /Users/bc/xx/marking-vue
> webpack-dev-server --content-base ./ --open --inline --hot --compress --history-api-fallback --config webpack.dev.config.js
sh: /Users/bc/xx/marking-vue/node_modules/.bin/webpack-dev-server: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! [email protected] dev: `webpack-dev-server --content-base ./ --open --inline --hot --compress --history-api-fallback --config webpack.dev.config.js`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the [email protected] dev 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/bc/.npm/_logs/2020-03-27T07_56_03_341Z-debug.log