Node error encountered while trying to fetch existing projects in Sanity.io.

5 replies
Last updated: Sep 20, 2023
Hi Team,I just returned to Sanity a couple of days ago after 2 years and there has quite some innovation going on here.
So I decide to play catch up but, I keep running into this error message.


βœ”οΈ Fetching existing projects

Error: getaddrinfo ENOTFOUND <http://b1gzrsxl.api.sanity.io|b1gzrsxl.api.sanity.io>

at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:69:26)

It's definitely a node issue but I tried versions 14, 16, 18 and 20 but same results.
Please any idea what seems to be the issue?

Here is the command I'm using and I install the latest sanity-cli and actually log into my account from the terminal.

npm create sanity@latest -- --template get-started --project b1gzrsxl --dataset production --provider google
AI Update

Welcome back! That's definitely a frustrating error to hit when you're trying to catch up on all the exciting changes. The good news is you're not alone - this getaddrinfo ENOTFOUND error is almost always a network/DNS resolution issue rather than a Node.js version problem.

Based on a similar case in the Sanity community, this was confirmed to be network-related and resolved once the network issues were sorted out. Here's what you can try:

1. Network & DNS troubleshooting The error means your system can't resolve b1gzrsxl.api.sanity.io to an IP address. Try:

  • Test DNS directly: Run nslookup b1gzrsxl.api.sanity.io or ping b1gzrsxl.api.sanity.io to see if your system can resolve the domain
  • Flush DNS cache:
    • macOS: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
    • Windows: ipconfig /flushdns
    • Linux: sudo systemd-resolve --flush-caches
  • Switch networks: Try a different WiFi network or mobile hotspot
  • Check VPN/proxy: Temporarily disable any VPN or check corporate proxy settings
  • Firewall: Corporate firewalls sometimes block subdomain patterns like *.api.sanity.io

2. Verify your project ID Double-check that b1gzrsxl is still a valid project in your account at sanity.io/manage. The fact that you can log in successfully but then hit this error suggests auth works but the project-specific endpoint doesn't resolve.

3. Node.js version note Since you've been away for 2 years, heads up that Sanity Studio v4 requires Node.js 20+. You mentioned trying v20 which is perfect - just verify you're actually running it with node --version.

4. Try the interactive approach Instead of passing all those flags, try:

npm create sanity@latest

This might handle the network requests differently during setup.

5. Check npm proxy settings If you're behind a corporate proxy:

npm config get proxy
npm config get https-proxy

Since the authentication works but project fetching fails, this really points to DNS/firewall issues with the subdomain pattern. Most people find switching networks or flushing DNS resolves it. Let us know if you're still stuck!

seems to me that project doesnt exist
is this the right project id
b1gzrsxl
Yep!Actually, I just tried again and as I suspected, it was a network-related issue. I'm now up and running
πŸ‘
that would explain the notfound error.
Yeah!I'm pretty sure I'll be back here with more questions, hopefully not network related
πŸ˜…

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?