[vue] vue-cli-service serve --mode development --dashboard Mac 上报错

vue-cli-service serve --mode development --dashboard

$ vue-cli-service serve --mode development --dashboard
 INFO  Starting development server...

[webpack.Progress] 0% compiling

[webpack.Progress] 10% building 0/0 modules 0 active 
[webpack.Progress] 10% building 0/1 modules 1 active multi /Users/jianwewa/js/vue_test/vue_shop/node_modules/webpack-dev-server/client/index.js?http://x86_64-apple-darwin13.4.0:8080/sockjs-node /Users/jianwewa/js/vue_test/vue_shop/node_modules/webpack/hot/dev-server.js ./src/main.js
[webpack.Progress] 10% building 1/1 modules 0 active 
[webpack.Progress] 10% building 1/1 modules 0 active 
[webpack.Progress] 10% building 1/2 modules 1 active multi /Users/jianwewa/js/vue_test/vue_shop/node_modules/webpack/hot/dev-server.js /Users/jianwewa/js/vue_test/vue_shop/node_modules/webpack-dev-server/client/index.js?http://x86_64-apple-darwin13.4.0:8080/sockjs-node ./src/main.js
[webpack.Progress] 10% building 2/2 modules 0 active 
events.js:282
      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo ENOTFOUND x86_64-apple-darwin13.4.0
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:64:26)
Emitted 'error' event on Server instance at:
    at GetAddrInfoReqWrap.doListen [as callback] (net.js:1492:12)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:64:17) {
  errno: -3008,
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'x86_64-apple-darwin13.4.0'
}
 

 不知道是Vue里什么逻辑,为什么会check hostname = x86_64-apple-darwin13.4.0, 可能是少安装了什么东西吧,知道的大佬给下解决。

搜索了网络,有2种方案

(1)在终端下,执行sudo unset HOST

             (2) 或者编辑,/etc/hosts 文件,推荐这个

[vue] vue-cli-service serve --mode development --dashboard Mac 上报错_第1张图片

127.0.0.1 x86_64-apple-darwin13.4.0 

 

或者

uset HOST

 

就解决了!

 

 

你可能感兴趣的:(vue.js,mac,os,x)