Vue-cli init not working on OSX 10.13.2
See original GitHub issueI am using OSX version 10.13.2 NPM version 5.5.1 Node version v9.2.1 vue-cli version is 2.9.2
Very similar to these issues, but all workarounds and fixes do not work. Am I still missing anything?
https://github.com/vuejs/vue-cli/issues/681 https://github.com/vuejs-templates/webpack/issues/1168
I am running
vue init webpack
? Generate project in current directory? Yes
? Project name reportui
? Project description Report UI Project
? Author kli kli@gmail.com
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? No
? Set up unit tests No
? Setup e2e tests with Nightwatch? No
? Should we run npm install
for you after the project has been created? (recommended) no
vue-cli · Generated “reportui”.
MacBook-Pro:reportui tor$ npm install
fsevents@1.1.3 install /Users/tor/Documents/rrr/reportui/node_modules/fsevents node install
[fsevents] Success: “/Users/tor/Documents/rrr/reportui/node_modules/fsevents/lib/binding/Release/node-v59-darwin-x64/fse.node” is installed via remote
uglifyjs-webpack-plugin@0.4.6 postinstall /Users/tor/Documents/rrr/reportui/node_modules/webpack/node_modules/uglifyjs-webpack-plugin node lib/post_install.js
npm notice created a lockfile as package-lock.json. You should commit this file. added 1105 packages in 16.042s MacBook-Pro:reportui tor$ npm run dev
reportui@1.0.0 dev /Users/tor/Documents/rrr/reportui webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
10% building modules 1/1 modules 0 activeevents.js:136
throw er; // Unhandled ‘error’ event
^
Error: getaddrinfo ENOTFOUND localhost
at errnoException (dns.js:55:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:97:26)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! reportui@1.0.0 dev: webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the reportui@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! /Users/tor/.npm/_logs/2017-12-20T15_24_43_537Z-debug.log
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (4 by maintainers)
Top GitHub Comments
The fix is very simple. Not everyone has 127.0.0.1 mapped to the localhost. That’s why it is not working.
Adding 127.0.0.1 localhost to /etc/hosts will fix the issue
Maybe someone in the vue community can add it to the step to step set up guide. Otherwise it drives people away from your framework.
in config/index.js
host: ‘localhost’ => host: ‘127.0.0.1’