Installing Sanity on a Mac via Terminal - helpful tips and instructions
Don't give up! Installing Sanity can be frustrating at first, but it's usually a quick fix once we identify the issue. Here's what you need to know to get past this:
The most common issue on Mac is Node.js version compatibility. Sanity Studio v4 requires Node.js version 20 or higher. If you have an older version installed, that's likely causing your installation problems.
Here's how to get up and running:
Check your Node.js version - Open Terminal and run:
node -vIf it shows anything below v20 (like v16 or v18), you need to update.
Install or update Node.js - Go to nodejs.org and download the LTS (Long Term Support) version, which will be v20 or higher. The installer will handle everything for you on Mac.
Verify npm is working - After installing Node, check that npm (the package manager) is also available:
npm -vCreate your Sanity project - Once Node.js 20+ is installed, you have two options:
Option A (Recommended) - Use the modern command:
npm create sanity@latestOption B - Use the traditional CLI approach:
npm install -g sanity@latest sanity initBoth commands will walk you through creating a new project with prompts for project name, dataset configuration, and template selection. The sanity init command provides an interactive setup that handles everything for you.
Common Mac-specific issues:
Permission errors: If you see
EACCESor permission errors when installing globally, don't usesudowith npm. Instead, you can usenpm create sanity@latestwhich doesn't require global installation, or configure npm to install packages globally without requiring sudo.Path issues: Make sure Terminal can find the
nodeandnpmcommands. Close and reopen Terminal after installing Node.js to refresh your environment.Multiple Node versions: If you've installed Node multiple times or used different methods, consider using a version manager like nvm to manage versions cleanly.
After successful installation, you can start your studio with:
npm run devWhat specific error message are you seeing in Terminal? That would help narrow down exactly what's going wrong. But in most cases, ensuring you have Node.js 20+ installed properly solves the issue immediately. You're almost there!
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.