vercel/next.js · error
Lockfile was successfully patched, please run "npm install"
Error message
Lockfile was successfully patched, please run "npm install" to ensure @next/swc dependencies are downloaded
What it means
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.
Source
Thrown at packages/next/src/lib/patch-incorrect-lockfile.ts:168
)
for (let i = 0; i < pkgsData.length; i++) {
const pkg = missingSwcPkgs[i]
const pkgData = pkgsData[i]
if (shouldPatchDependencies) {
patchDependency(pkg, pkgData)
}
if (shouldPatchPackages) {
patchPackage(`${pkgPrefix}${pkg}`, pkgData)
}
}
writeFileSync(
lockfilePath,
JSON.stringify(lockfileParsed, null, 2) + endingNewline
)
Log.warn(
'Lockfile was successfully patched, please run "npm install" to ensure @next/swc dependencies are downloaded'
)
} catch (err) {
Log.error(
`Failed to patch lockfile, please try uninstalling and reinstalling next in this workspace`
)
console.error(err)
}
}
View on GitHub (pinned to 0eb3775416)
Solutions
- Run `npm install` to download the @next/swc dependencies now that the lockfile is patched.
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at packages/next/src/lib/patch-incorrect-lockfile.ts:168 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of vercel/next.js@0eb3775416 (2026-08-19).
Data as JSON: /api/errors/b0e7b0651b899bd0.
Report an issue: GitHub.