How to fix 'sanity start' error in VSCode terminal?

2 replies
Last updated: Sep 1, 2023
Hey Everyone, im new to Sanity and programming in general and building my first ever project. I installed Sanity using the terminal in VScode, BUT when I try to run 'sanity start' i get the bellow error I can't figure out. Any ideas how i can get 'sanity start' to work
AI Update

Welcome to Sanity! The sanity start command doesn't exist in Sanity Studio v3 and later versions - that's why you're getting an error. The command was replaced with sanity dev for local development.

To fix this, run:

sanity dev

Or if you're using npm/pnpm/yarn:

npm run dev
# or
pnpm run dev
# or
yarn dev

Your Studio will then be available at http://localhost:3333.

What changed: When Sanity Studio v3 was released, the CLI commands were updated. The old sanity start command was replaced with sanity dev, which provides better performance with live reloading, faster cold starts, and uses Vite for the development server. The sanity start command now only serves production builds locally (after you've run sanity build).

Quick reference for common commands:

  • sanity dev - Start local development server (what you want!)
  • sanity build - Create a production build
  • sanity deploy - Deploy your Studio to Sanity's hosting

If you're still seeing errors after running sanity dev, make sure you have Node.js version 18 or higher installed (v20+ is required for Studio v4). You can check your version with node --version. If you need to update Node.js, download the latest LTS version from nodejs.org.

Show original thread
2 replies
I would highly recommend going through this Getting started with Sanity guide if it is your first time working with the product.That said, try
npm run dev
and see if you are able to launch the current setup of your studio in localhost.
thank you very much
user F
i watched the tutorial and reran my set up and it worked. Thanks again

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?