ERROR in Entry module not found: Error: Can't resolve 'webpack-dev-server --open' in 'D:\study\webpack-demo'
ERROR in (webpack)-dev-server/client?http://localhost:8080
Module build failed: Error: ENOENT: no such file or directory, open 'D:\study\webpack-demo\node_modules\webpack-dev-server\client\index.js'
@ multi (webpack)-dev-server/client?http://localhost:8080 ./src/index.js app[0]
ERROR in multi (webpack)-dev-server/client?http://localhost:8080 webpack-dev-server --open
Module not found: Error: Can't resolve 'webpack-dev-server --open' in 'D:\study\webpack-demo'
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack-dev-server --open start[1]
当你运行得项目中出现以上报错,看看webpack.config.js 文件中 配置是否出错?
derServer: {
contentBase: './dist'
},
解决方法:本地出错得原因是 , 键盘敲错了!或者 改正重新运行即可
devServer: { // 此处配置名称写错了
contentBase: ‘./dist’
},
entry: {
app: './src/index.js',
print: './src/print.js',
"start": "webpack-dev-server --open" // 或者此处引用错误
},
总结: 是webpack 原生结构的配置写错了