Vue运行的时候报错:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! financial@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the financial@1.0.0 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! C:\Users\linxue\AppData\Roaming\npm-cache\_logs\2018-11-20T08_53_45_379Z-debug.log
网上说版本问题,让npm i -D webpack-dev-server@版本号,没用啊,然后发现build中的webpack.dev.config.js中的
console.log(process.env.HOST) console.log(config.dev.host)
打印都是undefined;
这个本是获取来用在config中的index.js中配置的host中的,所以既然获取不到我就直接手动设置index.js的dev配置为自己的本地IP就行了,不要用localhost;
dev:{
host:'****'//自己本地ip
...
}