Next.js Discord

Discord Forum

npm run dev ,error

Answered
Ajay posted this in #help-forum
Open in Discord
trying to run next js for first time and encountering this, not sure why port is coming as [::] ,any help will be appreciated.
All of my other react projects are working just fine
Answered by Ajay
i was working with 13.4..19 changed to Next js 13.4.12 and eslint config next 13.4.12 and error resolved. Not sure why,but works
View full answer

8 Replies

The error message you're seeing, "Error: getaddrinfro ENotfound localhost," suggests that there is a problem resolving the hostname "localhost" to an IP address. This error typically occurs when a program or service is trying to establish a network connection to "localhost," but the system cannot find the IP address associated with that hostname.
Here are some steps you can take to troubleshoot and resolve this issue:

Check the spelling: Ensure that you have spelled "localhost" correctly in your configuration or code. It should be all lowercase, as "localhost."

Hosts File: On most systems, the "localhost" hostname is typically defined in the system's hosts file. Make sure that there is an entry for "localhost" in the hosts file, and it should point to the loopback address "127.0.0.1." The location of the hosts file varies depending on your operating system:

Windows: C:\Windows\System32\drivers\etc\hosts
Linux/Unix: /etc/hosts
macOS: /private/etc/hosts
Open the hosts file with administrative privileges (e.g., using an editor with sudo) and check for the "localhost" entry.

Network Configuration: Ensure that your network configuration is functioning correctly. It's rare, but if there are issues with your network adapter or configuration, it can affect hostname resolution.

DNS Configuration: If your system is configured to use DNS servers, make sure that the DNS resolver is working correctly and can resolve "localhost" to the loopback address.

Firewall/Antivirus: Sometimes, firewall or antivirus software can interfere with network connections. Check if any such software is blocking connections to "localhost."

Port Availability: If you are trying to connect to a specific port on "localhost," ensure that the application or service you are trying to reach is actually running and listening on that port.

Node.js/npm: If you are working with Node.js or npm, it's possible that there's an issue with your project's configuration or dependencies. Make sure your application is properly configured and dependencies are installed correctly.

Restart Services: Sometimes, simply restarting the service or application that's encountering the issue can resolve it.

Check for Typos: Review your code or configuration for any typos or syntax errors that could be causing the issue.
If none of these steps resolve the issue, please provide more context about the specific software or service you are trying to run, as well as any relevant code or configuration files, so that I can provide more targeted assistance.
i was working with 13.4..19 changed to Next js 13.4.12 and eslint config next 13.4.12 and error resolved. Not sure why,but works
Answer
Yeah there are several major bugs since 13.4.13 that is yet to be addressed
Giant panda
sounds like a local dns issue. Try doing 127.0.0.1
127.0.0.1 = [::] (so your solution doesn't help + he has solved it by downgrading)