1、项目引入vue里之后,没有node_modull,显示错误如下:
'webpack-dev-server' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! onlinefontend@1.0.3 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 1
npm ERR! Failed at the onlinefontend@1.0.3 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:_
解决方法:
1.先卸载旧版本的webpack :npm uninstall webpack -g
2.安装新的正确版本:npm install webpack-dev-server@2.9.7
3.npm run dev
原因:应该是因为当时下载 版本时没有和给的对应,下载的为测试版本不稳定