sanity start" fails with "Command not available outside project context

25 replies
Last updated: Jan 28, 2026
I'm having issues with running "sanity start" I am in the studio directory and I get the following error: Error: Command "start" is not available outside of a Sanity project context.Run the command again within a Sanity project directory, where "@sanity/core"
is installed as a dependency.
AI Update

This error typically means that the CLI can't find the proper Sanity project dependencies in your current directory. Here are the most common causes and solutions:

1. Check your package.json

Make sure you have sanity (or @sanity/core for older versions) listed as a dependency. Your package.json should include something like:

{
  "dependencies": {
    "sanity": "^3.x.x",
    // other dependencies...
  }
}

2. Install dependencies

If you just cloned the project or the dependencies aren't installed, run:

npm install
# or
yarn install
# or
pnpm install

3. Use the correct command

For Sanity v3, the preferred command is actually sanity dev (not sanity start). Try running:

npx sanity dev
# or if you have the CLI installed globally
sanity dev

The sanity start command is legacy from v2. The modern sanity dev command provides better performance with live reloading.

4. Verify you're in the right directory

Make sure you're actually in the Studio directory. Look for:

  • A sanity.config.ts (or .js) file
  • A sanity.cli.ts (or .js) file
  • A package.json with Sanity dependencies

5. Reinstall Sanity if needed

If dependencies are corrupted, try:

npm uninstall sanity
npm install sanity@latest

6. Check for global CLI issues

If you're using a globally installed CLI, it might be outdated. Update it:

npm install -g sanity@latest

After fixing the dependencies, run sanity dev (or npm run dev if that's configured in your package.json scripts) to start your Studio.

Show original thread
25 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?