What is the difference between yarn and npm?
Good question! There's actually an important difference between Sanity Studio v2 and v3 here.
In Sanity Studio v3 (current version)
sanity install is deprecated and no longer needed. You should use your regular package manager directly:
npm install @sanity/color-input
# or
yarn add @sanity/color-input
# or
pnpm add @sanity/color-inputIn v3, plugins are just regular npm packages that you install and then add to your sanity.config.ts file manually. There's no special sanity install command functionality.
In Sanity Studio v2 (legacy)
sanity install was not just an alias - it actually did two things:
- Installed the package (using npm or yarn under the hood, depending on what you had)
- Automatically added the plugin to your
sanity.jsonconfig file
So sanity install @sanity/color-input would both install the package AND add it to the plugins array in your sanity.json configuration file. This was a convenience feature of the v2 CLI that automated the two-step process.
Why the change?
In v3, Sanity moved away from the CLI managing your config automatically. The modern approach gives you more control - you manually import and configure plugins in your sanity.config.ts file:
import {defineConfig} from 'sanity'
import {colorInput} from '@sanity/color-input'
export default defineConfig({
// ... other config
plugins: [colorInput()]
})This aligns with modern JavaScript tooling practices and gives you better type safety and IDE support.
Bottom line: If you're on Studio v3 (which you should be, as v2 is deprecated), just use npm install or your preferred package manager. The sanity install command is deprecated and you don't need it anymore - just install the package and manually add it to your config file.
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.