Error: getaddrinfo enoent error resolution

error: getaddrinfo enoent error resolution

When NPM run dev is used to run Vue project, error: getaddrinfo enoent is reported as follows:

Cause of the problem:

Localhost is not bound to 127.0.0.1

resolvent:

Find the hosts file in C:// Windows/system32/Drivers/etc , add 127.0.0.1 to the hosts file, and save it, as shown in the figure below:

Read More: