美文网首页
npm run dev 报错

npm run dev 报错

作者: 黑白说程序 | 来源:发表于2020-09-23 08:39 被阅读0次

当使用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"}

相关文章

网友评论

      本文标题:npm run dev 报错

      本文链接:https://www.haomeiwen.com/subject/yibgyktx.html