Issue installing the official sanity media plugin on Sanity v3.
The issue you're encountering is a peer dependency conflict with the sanity-plugin-media package. The version you're trying to install with the @studio-v3 tag (2.0.0-v3-studio.3) was built for Sanity v3's dev-preview/release candidate versions, but you're running the stable release of Sanity v3 (3.2.3).
According to the official plugin page, here's how to fix this:
Install the latest stable version instead:
npm install sanity-plugin-mediaDon't specify the @studio-v3 tag – that was only for the preview/RC period during Sanity v3's development. The current stable version of sanity-plugin-media (version 2.x and above) already supports Sanity v3 out of the box.
Then add it to your sanity.config.ts (or .js):
import {defineConfig} from 'sanity'
import {media} from 'sanity-plugin-media'
export default defineConfig({
// ... other config
plugins: [
media()
]
})The confusion here is common – during Sanity v3's development period, plugin authors used tags like @studio-v3 or @v3-studio to indicate preview compatibility. Now that Sanity v3 is stable, the main package versions have caught up, and those old tags are outdated with incompatible peer dependencies (specifically looking for sanity@"dev-preview || 3.0.0-rc.0" instead of stable versions like your 3.2.3).
If you still encounter issues:
- Delete
node_modulesandpackage-lock.json - Run
npm installagain - Or use the
--legacy-peer-depsflag:npm install sanity-plugin-media --legacy-peer-deps(though this shouldn't be necessary with the correct version)
Your Node v18 LTS setup is perfectly fine for Sanity v3, so that's not causing the issue. The plugin will work as both a standalone tool (accessible in your studio menu) and as an additional asset source for your image and file fields once properly installed.
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.