👀 Our most exciting product launch yet 🚀 Join us May 8th for Sanity Connect

Installing Sanity on a Mac via Terminal - helpful tips and instructions

11 replies
Last updated: May 12, 2022
i need help please. giving up on sanity already.. ijust dont know why its so frustrating installing sanity on my mAC via the terminal
May 11, 2022, 10:48 PM
Hey there! What sort of issues are you having?
May 11, 2022, 10:57 PM
thank you. it returns EACCESS .. and when I add sudo to the begining, it asks for a password… i dont know what the password should be.
May 11, 2022, 11:24 PM
The password will be the same on that you use to login to your computer.
May 11, 2022, 11:26 PM
Really sorry this is frustrating. Managing node can be rough for even seasoned web developers.
Here’s a detailed
recent article on installing node with nvm (node version manager) on mac.
Here’s my own quick and dirty that may help you:
1. install
Homebrew (note: the xcode tools download can take a while if you haven’t done this yet on your mac)2. instead of installing node with brew…
3. install nvm with brew:
brew install nvm
4. install the latest node “lts” version (
nvm instructions )5. check your node (
node -v
) and npm (
npm -v
) versions. Both should return something. If so, you’re ready to install the cli6. now install the sanity cli globally:
npm install -g @sanity/cli
7. check if the cli is installed:
sanity --help
should return a list of options8. go ahead and log into the sanity cli:
sanity login
- use your existing sanity account or create a new one if you haven’t yet9. NOW you should be good to go to create a new studio with
sanity init
or install modules in an existing studio with
sanity install
then
sanity start
to turn on your local dev server!
May 11, 2022, 11:28 PM
For more recent macOS versions, I do not think that you should need to run any of these commands with sudo and would avoid it unless the linked instructions say so.
May 11, 2022, 11:29 PM
running sudo with any of the brew, node, or npm module commands above might actually install things in a different directory than expected and cause unexpected results when you go to use the cli in your project
May 11, 2022, 11:30 PM
but I installed NODE already? downloaded it from the website and then installed it on my mac. Please Is there any additional installing process other than those I mentioned?
May 11, 2022, 11:42 PM
user M
thanks alot. I’ve got the password.
May 11, 2022, 11:46 PM
If this works for you, you should be good to continue.
check your node (
node -v
) and npm (
npm -v
) versions. Both should return something
Here are some quick commands from my computer to make sure everything is installed:
~
(✿◠‿◠)ノ node -v
v18.0.0

~
(✿◠‿◠)ノ npm -v
8.6.0

~
(✿◠‿◠)ノ sanity -v
@sanity/cli version 2.29.8

~
(✿◠‿◠)ノ npm -g list
/Users/jules/.nvm/versions/node/v18.0.0/lib
├── @sanity/cli@2.29.8
├── corepack@0.10.0
├── newman@5.3.2
└── npm@8.6.0
May 11, 2022, 11:47 PM
You're welcome
user F
! Were you able to complete your install?
May 11, 2022, 11:49 PM
user M
Yes I was. Thanks
May 12, 2022, 12:26 AM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?