
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI understand your frustration! Based on the official Sanity CLI documentation, the sanity init command does include a --package-manager flag that lets you specify which package manager to use.
However, I need to be honest: the official documentation doesn't explicitly state whether the CLI automatically detects lock files. The docs only mention that you can specify a package manager manually with the flag.
If the CLI isn't respecting your package-lock.json file automatically, here are your options:
1. Use the explicit flag during initialization:
sanity init --package-manager npm2. Use npm's create command instead:
npm create sanity@latestThis approach uses npm's native project scaffolding, which should respect your npm workflow.
3. For existing projects: If you already have a Sanity project and want to ensure npm is used for all operations:
yarn.lock file if it existsnpm install to generate/update your package-lock.jsonnpm run dev, npm install, etc.) going forwardThe Sanity CLI commands like sanity dev and sanity deploy should work fine regardless of which package manager installed the dependencies.
About your feedback as a paid customer: Your point is valid. Many modern CLI tools (like Create React App, Vite, etc.) do automatically detect lock files, and it would be a nice quality-of-life improvement if Sanity's CLI had more explicit documentation about this behavior—or better automatic detection if it's not already implemented.
If this is a significant pain point for your team, I'd recommend opening a feature request on the Sanity GitHub discussions or reaching out to Sanity support. They're generally responsive to customer feedback, especially from paid plan users.
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