
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThis is a classic PATH issue with npm global installations. The zsh: command not found: sanity error means your terminal can't find the globally installed Sanity CLI binary. Here's how to fix it:
The most reliable solution is to use NVM (Node Version Manager) as it properly manages your PATH configuration:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bashnvm install 16 # or whatever version you prefer
nvm use 16nvm alias default 16npm install -g @sanity/cliThis should resolve the issue permanently for all new terminal sessions.
If you prefer not to use NVM, you need to add npm's global bin directory to your PATH:
npm bin -g.zshrc (note the .bin at the end):export PATH="/Users/yourusername/node_modules/.bin:$PATH"source ~/.zshrcWhile fixing your PATH, you can always run Sanity commands using npx:
npx -y sanity@latest [command]The NVM approach is recommended because it handles all the PATH configuration automatically and avoids permission issues with global npm installations. Based on the Sanity CLI documentation, this is a common setup issue that's typically resolved by proper Node.js environment configuration.
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.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store