
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThe error you're encountering is happening because you're running Node.js v16.20.0, but current versions of Sanity Studio require Node.js 18 or higher (and as of Studio v4, Node.js 20+ is required).
The crypto$2.getRandomValues is not a function error is a symptom of Vite (which Sanity Studio uses under the hood) trying to use crypto APIs that aren't available or are implemented differently in older Node.js versions.
You need to upgrade your Node.js version. Here's what to do:
Install Node.js 20 or higher (recommended to use the latest LTS version)
Verify your Node version after installation:
node -vYou should see v20.x.x or higher
Reinstall your dependencies:
yarn installTry running dev again:
yarn devWhen you ran yarn upgrade, it updated Sanity packages to newer versions that require Node.js 20+. As explained in Sanity's blog post about Studio v4, this requirement was introduced because Node.js 18 reached end-of-life in April 2024, and the upgrade allows Sanity to use modern tooling like Vite 7 for faster builds and better performance.
The good news is that once you upgrade Node.js, everything should work smoothly!
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