Sanity CLI not working on M1 Mac with Gatsby blog starter

28 replies
Last updated: Jan 28, 2026
Hey folks! Anyone have any experience using the Sanity CLI with an M1 Mac? I’m trying to resurrect an old project and trying to upgrade all dependencies but it seems like the CLI just doesn’t wanna run. This project was bootstrapped from the Gatsby blog starter
AI Update

I've run into similar issues upgrading older Sanity projects on M1 Macs! The good news is this is almost always a Node.js version mismatch rather than an M1-specific problem.

Here's what's likely happening: Your old Gatsby blog starter was probably using Sanity Studio v3, which required Node.js 18. However, if you're upgrading dependencies to current versions, you need to know that Sanity Studio v4 now requires Node.js 20 or higher. This change happened because Node.js 18 reached end-of-life in April 2024.

Quick fix steps:

  1. Check your Node version: Run node -v in your terminal. If you're on anything below Node 20, that's your issue.

  2. Upgrade to Node 20+: I'd recommend using a version manager like nvm (Node Version Manager) since you're working with an older project that might need different Node versions:

    nvm install 20
    nvm use 20
  3. Reinstall dependencies: After switching Node versions:

    rm -rf node_modules package-lock.json
    npm install
  4. Reinstall the Sanity CLI globally (if you have it installed globally):

    npm install -g @sanity/cli

The M1 Mac itself should work fine with Sanity CLI - Apple Silicon has been well-supported for a while now. The issue is almost certainly the Node version compatibility.

If you're still having issues after upgrading Node, check that your PATH environment variable is properly configured so node -v and npm -v work from the command line. Sometimes on M1 Macs, if you've installed Node through different methods (Homebrew, nvm, direct installer), there can be PATH conflicts.

Good luck with resurrecting that project!

Show original thread
28 replies

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?