npm run dev报这个错 怎么办?
F:\mooc\vue-demo>npm run dev > vue-demo@1.0.0 dev F:\mooc\vue-demo > cross-env NODE_ENV=development webpack-dev-server --config webpack.config.js F:\mooc\vue-demo\node_modules\_webpack-dev-server@3.1.9@webpack-dev-server\bin\webpack-dev-server.js:363 throw err; ^ TypeError: Cannot match against 'undefined' or 'null'. at addHooks (F:\mooc\vue-demo\node_modules\_webpack-dev-server@3.1.9@webpack-dev-server\lib\Server.js:103:48) at new Server (F:\mooc\vue-demo\node_modules\_webpack-dev-server@3.1.9@webpack-dev-server\lib\Server.js:116:5) at startDevServer (F:\mooc\vue-demo\node_modules\_webpack-dev-server@3.1.9@webpack-dev-server\bin\webpack-dev-server.js:355:14) at processOptions (F:\mooc\vue-demo\node_modules\_webpack-dev-server@3.1.9@webpack-dev-server\bin\webpack-dev-server.js:309:5) at Object.<anonymous> (F:\mooc\vue-demo\node_modules\_webpack-dev-server@3.1.9@webpack-dev-server\bin\webpack-dev-server.js:424:1) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! vue-demo@1.0.0 dev: `cross-env NODE_ENV=development webpack-dev-server --config webpack.config.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the vue-demo@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\li\AppData\Roaming\npm-cache\_logs\2018-10-17T04_34_48_449Z-debug.log F:\mooc\vue-demo>
请问楼主这个问题解决了吗~
你的 webpack.config.js 配置有问题, 看下你的vue-loader 的版本,最新的 vue-loader 还需要在 webpack.config.js中的plugins 中使用