Next.js Discord

Discord Forum

ERR_PNPM_OUTDATED_LOCKFILE on Nextra project

Answered
Blue Mockingbird posted this in #help-forum
Open in Discord
Blue MockingbirdOP
Hello guys, I'm working on a Nextra-Docs project and wanting to update I ran the npm i next@latest
It all works well in my VS code and github but I'm seeing this failed deployment error on Vercel which I haven't been able to figure out :blobsweats:
Here are the logs I'm getting:
[09:37:57.694] Running "vercel build"
[09:37:58.189] Vercel CLI 32.1.0
[09:37:58.608] Installing dependencies...
[09:37:59.144] Lockfile is up-to-date, resolution step is skipped
[09:37:59.147]  ERR_PNPM_OUTDATED_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up-to-date with package.json
[09:37:59.147]
[09:37:59.147] Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"
[09:37:59.165] Error: Command "pnpm install" exited with 1

I included a small screenshot of the package.json and pnpm-lock.yaml files for context,
What I tried is replacing all the "13.0.6" (next: ^13.0.6) of the pnpm-lock.yaml with 13.4.9 instead but I got the same result on Vercel.

I'm really not sure what can I do in this case 🤔
Answered by joulev
Try rerunning pnpm install to recreate the lock file
View full answer

4 Replies

Answer
@joulev Try rerunning pnpm install to recreate the lock file
Blue MockingbirdOP
Yup that worked, weird thing I was not using pnpm I was using only npm on the project (fairly new to this) so I might have missed something but that worked, thank you 🤘🏻
@Blue Mockingbird Yup that worked, weird thing I was not using pnpm I was using only npm on the project (fairly new to this) so I might have missed something but that worked, thank you 🤘🏻
that means you are having a pnpm-lock.yaml file that you shouldn't have.

lock file for npm is package-lock.json
for yarn is yarn.lock
for pnpm is pnpm-lock.yaml
for bun is bun.lockb

choose one package manager to use and keep the lock file for that package manager and remove all other lockfiles
the reason you shouldn't keep many lock files at the same time is because many services like vercel rely on the presence of lockfiles to determine what package manager to use, and if you keep many of them at the same time then those services will get it wrong, as in your problem here