← All fixes
ERR_PNPM_OUTDATED_LOCKFILE: Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date
#175Error
ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with package.json
Why it happens, and why this works
CI (and Vercel) install with --frozen-lockfile, which refuses to change the lockfile. package.json was edited (or a dependency added) without running pnpm install locally and committing the updated pnpm-lock.yaml. A different pnpm major version locally vs CI can also rewrite the lockfile format.
Fix
1. Run pnpm install locally, then commit pnpm-lock.yaml together with package.json. 2. Pin the pnpm version for everyone: "packageManager": "pnpm@<version>" in package.json (Corepack and Vercel respect it). 3. In a monorepo, run install from the workspace root, not a subpackage. 4. Don't switch CI to --no-frozen-lockfile; that hides the drift.
Did it work?
No reports yet0 worked0 didn't
Tried it yourself?
Related fixes
ERR_PACKAGE_PATH_NOT_EXPORTED when importing a file deep inside a package
#29Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/helper' is not defined by "exports" in /app/node_modules/mylib/package.json
Importing a JSON file in ESM fails: needs an import attribute of type json
#26TypeError [ERR_IMPORT_ATTRIBUTE_MISSING]: Module "file:///app/config.json" needs an import attribute of "type: json"
nodeVerifiedNo reports yet
ModuleNotFoundError: No module named 'yaml' (the pip package is pyyaml)
#95ModuleNotFoundError: No module named 'yaml'
pythonVerifiedNo reports yet