坑:Error: listen EADDRNOTAVAIL 192.168.1.131:8888

昨天还用的很好的机器今天关机重启电脑之后重新npm run dev,就报错了:

> [email protected] dev E:\code\git\front-trial
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

 10% building modules 0/1 modules 1 active ... webpack/hot/dev-server ./src/main
 10% building modules 1/1 modules 0 activeevents.js:183
      throw er; // Unhandled 'error' event
      ^

**Error: listen EADDRNOTAVAIL 192.168.1.131:9999**
    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 --inline --progress --config
build/webpack.dev.conf.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\~\AppData\Roaming\npm-cache\_logs\2018-06-07T09_20_08_8
77Z-debug.log

错误就是在:Error: listen EADDRNOTAVAIL 192.168.1.131:9999,那么原因是什么呢?因为机器重启,DHCP重新分配了IP。
重新配置工程绑定当前分配的IP就可以了,或者修改本机的IP为静态IP,问题就解决了。

你可能感兴趣的:(坑:Error: listen EADDRNOTAVAIL 192.168.1.131:8888)