npm run dev运行vue项目时报错

使用npm run dev 运行一个新的vue项目时,报错如下:

sh: 1: webpack-dev-server: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! [email protected] dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js "8088"`
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!     /home/joker/.npm/_logs/2018-10-12T04_06_22_626Z-debug.log
joker@joker-PC:~/Downloads/vueTest/src$ npm uninstall webpack-dev-server
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

removed 83 packages in 25.961s

 

解决办法: 卸载npm uninstall webpack-dev-server,安装npm i [email protected]

在运行,成功启动。如有更好的解决方案欢迎指正!

你可能感兴趣的:(vue)