For the complete documentation index, see llms.txt. This page is also available as Markdown.

NPM, PNPM, Yarn - corrupt lockfile

A corrupt lockfile is most commonly caused by a mismatch in node, npm, pnpm or yarn versions between your project and AutoFix. Make sure to configure the node and package manager version in your package.json.

AutoFix uses the node & npm version specified in the engines section of your package.json file. Make sure the node version and npm version in your package.json match the version you're using locally and in your CI/CD. By algining the versions, you will avoid changes to the package-lock.json files by AutoFix.

For example:

{
  "engines": {
    "node": "22",
    "npm": "11.14.1",
    "pnpm": "11.7.0",
    "yarn": "^4.17.11"
  }
}

Last updated

Was this helpful?