{"record":{"id":"b0e7b0651b899bd0","repo":"vercel/next.js","slug":"lockfile-was-successfully-patched-please-run-npm","errorCode":null,"errorMessage":"Lockfile was successfully patched, please run \"npm install\" to ensure @next/swc dependencies are downloaded","messagePattern":"Lockfile was successfully patched, please run \"npm install\" to ensure @next/swc dependencies are downloaded","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/lib/patch-incorrect-lockfile.ts","lineNumber":168,"sourceCode":"    )\n\n    for (let i = 0; i < pkgsData.length; i++) {\n      const pkg = missingSwcPkgs[i]\n      const pkgData = pkgsData[i]\n\n      if (shouldPatchDependencies) {\n        patchDependency(pkg, pkgData)\n      }\n      if (shouldPatchPackages) {\n        patchPackage(`${pkgPrefix}${pkg}`, pkgData)\n      }\n    }\n\n    writeFileSync(\n      lockfilePath,\n      JSON.stringify(lockfileParsed, null, 2) + endingNewline\n    )\n    Log.warn(\n      'Lockfile was successfully patched, please run \"npm install\" to ensure @next/swc dependencies are downloaded'\n    )\n  } catch (err) {\n    Log.error(\n      `Failed to patch lockfile, please try uninstalling and reinstalling next in this workspace`\n    )\n    console.error(err)\n  }\n}\n","sourceCodeStart":150,"sourceCodeEnd":178,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/lib/patch-incorrect-lockfile.ts#L150-L178","documentation":"After rewriting the lockfile with the missing @next/swc package entries, patchIncorrectLockfile warns that npm install must be run so the newly referenced native binary packages actually download; otherwise the SWC binding remains unresolved.","triggerScenarios":"Thrown at packages/next/src/lib/patch-incorrect-lockfile.ts:168 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run `npm install` to download the @next/swc dependencies now that the lockfile is patched."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}