
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI understand you're hitting errors with sanity init after updating Sanity. Without seeing the specific error in your screenshot, the most likely culprit is Node.js version compatibility.
Check Your Node.js Version First
Sanity Studio v4 requires Node.js 20 or higher. This is a hard requirement introduced because Node.js 18 reached end-of-life in April 2024. Check your current version:
node -vIf you're on Node 18 or lower, that's almost certainly causing your sanity init failures. You'll need to upgrade to Node.js 20 or higher.
Why This Matters
When you updated Sanity with npm install --global sanity@latest, you likely pulled down Sanity v4, which won't run on older Node versions. The error might manifest as cryptic messages like crypto$2.getRandomValues is not a function or other initialization failures, regardless of which project name or dataset type you choose.
After Upgrading Node
Once you're on Node 20+, try sanity init again. The command should work normally and walk you through:
Alternative Installation Methods
If you continue having issues after confirming Node 20+:
npm cache clean --forcenpm install --global sanity@latestnpx sanity@latest initCommon Related Issues
The Node.js 20+ requirement is the only breaking change in Sanity Studio v4. If you have an existing v3 studio, the upgrade requires no code changes—just the Node version bump. This is why the version went from v3 to v4 despite no API changes: dropping Node version support is technically a breaking change under semantic versioning.
The fact that you're getting errors with different project names and dataset types points to an environmental issue (like Node version) rather than a configuration problem. Once your Node version is compatible, sanity init should work as expected.
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.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store