Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run vue project getaddrinfo ENOTFOUND localhost error

I have initialized a nuxt project and when I try to run it with npm run dev or yarn dev command it returns this error :

    build [==================  ] 91%Error: getaddrinfo ENOTFOUND localhost
    at errnoException (dns.js:50:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
error Command failed with exit code 1.

Any idea where does it come from ?

like image 439
Alireza HI Avatar asked Dec 11 '25 14:12

Alireza HI


1 Answers

add 127.0.0.1 localhost to /etc/hosts

like image 91
rtlin Avatar answered Dec 14 '25 16:12

rtlin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!