Andrew Mok

Node.js error: getaddrinfo ENOTFOUND localhost

1 min read

The error getaddrinfo ENOTFOUND localhost is caused by Webpack cannot found localhost address.

To solve it, open the terminal:

  1. sudo nano /etc/hosts
  2. Add following into the hosts file and save it.

    127.0.0.1 localhost

References:

Andrew Mok

Andrew Mok, a web developer from Hong Kong. I write and I code.