vue-book
vue-book copied to clipboard
关于webpack指定域名报错问题
配置文件如下: { "name": "demo", "version": "1.0.0", "description": "", "main": "main.js", "scripts": { "test": "echo "Error: no test specified" && exit 1", "dev": "webpack-dev-server --host 192.168.105.105 --port 8888 --open --config webpack.config.js" }, "author": "", "license": "ISC", "devDependencies": { "webpack": "^4.10.2", "webpack-dev-server": "^3.1.4" }, "dependencies": { "webpack-cli": "^3.0.1" } } 问题描述:"dev": "webpack-dev-server (--host 192.168.105.105)去掉就可以使用 --port 8888 --open --config webpack.config.js"。 网上查资料,也是这么用的。 如何解决呢。 报错信息:events.js:183 throw er; // Unhandled 'error' event ^
Error: listen EADDRNOTAVAIL 192.168.105.105:8888
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at Server.setupListenHandle [as _listen2] (net.js:1338:19)
at listenInCluster (net.js:1396:12)
at doListen (net.js:1505:7)
at _combinedTickCallback (internal/process/next_tick.js:141:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:695:11)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: webpack-dev-server --host 192.168.105.105 --port 8888 --open --config webpack.config.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2018-06-04T0 7_03_54_354Z-debug.log
我也遇到了,不过设置成与自己电脑的IPv4一样就可以了
还有你webpack4版本按照书上的流程走下去,后面肯定肯定一堆报错,还是按给的demo来吧