angular / angular2-seed

MIT License
1.01k stars 640 forks source link

build modulesError: getaddrinfo ENOTFOUND localhost #153

Closed harryjacksol closed 7 years ago

harryjacksol commented 7 years ago

Hi,

Today i started my project and i faced below error.

harry3@harry3:/var/www/carenet$ sudo npm start

angular2-seed@1.0.0 start /var/www/carenet npm run server

angular2-seed@1.0.0 server /var/www/carenet webpack-dev-server --inline --colors --progress --display-error-details --display-cached --port 3002 --content-base src

46% 6/10 build modulesError: getaddrinfo ENOTFOUND localhost at errnoException (dns.js:28:10) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)

npm ERR! Linux 3.13.0-106-generic npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "server" npm ERR! node v7.3.0 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE npm ERR! angular2-seed@1.0.0 server: webpack-dev-server --inline --colors --progress --display-error-details --display-cached --port 3002 --content-base src npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the angular2-seed@1.0.0 server script 'webpack-dev-server --inline --colors --progress --display-error-details --display-cached --port 3002 --content-base src'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the angular2-seed package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! webpack-dev-server --inline --colors --progress --display-error-details --display-cached --port 3002 --content-base src npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs angular2-seed npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls angular2-seed npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /var/www/carenet/npm-debug.log

npm ERR! Linux 3.13.0-106-generic npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" npm ERR! node v7.3.0 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE npm ERR! angular2-seed@1.0.0 start: npm run server npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the angular2-seed@1.0.0 start script 'npm run server'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the angular2-seed package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! npm run server npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs angular2-seed npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls angular2-seed npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /var/www/carenet/npm-debug.log

On last friday, it was working properly. when i come today and start project i faced this error.

my node and npm versions are latest. node version:- v7.3.0 npm version:- 3.10.10

i removed nodemodules and reinstalled it still the same issue.

i dont understand why this happens.

harryjacksol commented 7 years ago

i solved it. my localhost was working stopped. so that i faced this error. i changed in the /etc/hots file. i just add 127.0.0.1 localhost at the top of the file and it solved. now it works perfectly