npm run dev 报错
当使用webpack打包时报错会提示
ERROR in ./node_modules/querystring-es3/index.js
Module not found: Error: Can't resolve './decode' in 'C:\wamp64\www\studywebpack\node_modules\querystring-es3'
@ ./node_modules/querystring-es3/index.js 3:33-52
@ ./node_modules/url/url.js
@ (webpack)-dev-server/client?http://localhost:8085
@ multi (webpack)-dev-server/client?http://localhost:8085 ./src/main.js
ERROR in ./node_modules/querystring-es3/index.js
Module not found: Error: Can't resolve './encode' in 'C:\wamp64\www\studywebpack\node_modules\querystring-es3'
@ ./node_modules/querystring-es3/index.js 4:37-56
@ ./node_modules/url/url.js
@ (webpack)-dev-server/client?http://localhost:8085
@ multi (webpack)-dev-server/client?http://localhost:8085 ./src/main.js
ERROR in (webpack)-dev-server/client?http://localhost:8085
Module not found: Error: Can't resolve './overlay' in 'C:\wamp64\www\studywebpack\node_modules\webpack-dev-server\client'
@ (webpack)-dev-server/client?http://localhost:8085 10:16-36
@ multi (webpack)-dev-server/client?http://localhost:8085 ./src/main.js
ERROR in (webpack)-dev-server/client?http://localhost:8085
Module not found: Error: Can't resolve './socket' in 'C:\wamp64\www\studywebpack\node_modules\webpack-dev-server\client'
@ (webpack)-dev-server/client?http://localhost:8085 9:15-34
@ multi (webpack)-dev-server/client?http://localhost:8085 ./src/main.js
ERROR in ./node_modules/url/url.js
Module not found: Error: Can't resolve './util' in 'C:\wamp64\www\studywebpack\node_modules\url'
@ ./node_modules/url/url.js 25:11-28
@ (webpack)-dev-server/client?http://localhost:8085
@ multi (webpack)-dev-server/client?http://localhost:8085 ./src/main.js
ERROR in (webpack)-dev-server/client?http://localhost:8085
Module not found: Error: Can't resolve 'strip-ansi' in 'C:\wamp64\www\studywebpack\node_modules\webpack-dev-server\client'
@ (webpack)-dev-server/client?http://localhost:8085 7:18-39
@ multi (webpack)-dev-server/client?http://localhost:8085 ./src/main.js
ERROR in (webpack)-dev-server/client?http://localhost:8085
Module not found: Error: Can't resolve 'webpack/hot/emitter' in 'C:\wamp64\www\studywebpack\node_modules\webpack-dev-server\client'
@ (webpack)-dev-server/client?http://localhost:8085 214:23-53
@ multi (webpack)-dev-server/client?http://localhost:8085 ./src/main.js
解决方法:在packjson.js中的scripts修改命令--open改为--no-inline
"scripts" : {
"dev" : "webpack-dev-server --no-inline"}