Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Connecting to MongoDB via localhost can fail in node.js v17 and above #8

Closed
toBeOfUse opened this issue Nov 11, 2022 · 1 comment
Closed

Comments

@toBeOfUse
Copy link
Contributor

toBeOfUse commented Nov 11, 2022

As described in this Mongoose issue: depending on your operating system configuration, in node v17 and above, localhost can resolve to the IPv6 address ::1 instead of the usual IPv4 loopback address 127.0.0.1, which kept me from being able to connect to the MongoDB server on my local device when running this project, because MongoDB needs to be started from the command line with a special flag before it will support IPv6 connections. The IPv4/IPv6 issue could be disambiguated by changing the URI in projects/server/.env from localhost to 127.0.0.1.

@cseitz
Copy link
Contributor

cseitz commented Nov 17, 2022

I've pushed this change to main!

@cseitz cseitz closed this as completed Nov 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants