Error creating new project through CLI due to certificate verification issue
This is a common Node.js/npm TLS certificate error that typically occurs when your Node environment can't verify SSL certificates. It's not specific to Sanity, but happens during the CLI installation when npm tries to fetch packages securely. Here are the most common solutions:
Quick fixes to try:
Check your Node.js version - Make sure you're using a current version of Node.js (20+ is required for Sanity Studio v4). Older versions may have outdated certificate chains:
node --versionDisable strict SSL temporarily (not recommended for production, but useful for troubleshooting):
npm config set strict-ssl false npm -y create sanity@latest # Then re-enable it after: npm config set strict-ssl trueUpdate your npm CA certificates:
npm config set cafile "" npm cache clean --forceCheck if you're behind a corporate proxy/firewall - If you're on a corporate network, you may need to configure npm to use your company's proxy or certificate:
npm config set proxy http://your-proxy:port npm config set https-proxy http://your-proxy:portTry using a different registry temporarily:
npm config set registry https://registry.npmjs.org/
Most likely causes:
- Corporate firewall/proxy intercepting SSL connections
- Antivirus software interfering with SSL
- Outdated Node.js installation with old root certificates
- VPN or network security software
Since the error happens during "Resolving latest module versions," it's occurring when npm tries to fetch Sanity packages from the registry. Try the strict-ssl workaround first to confirm it's a certificate issue, then work on the proper solution based on your network environment.
If you're on a corporate network, you'll likely need to get the proper CA certificate from your IT team and configure npm to use it.
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.