14

When I deploy my project to Vercel, the build fails with this error:

ERR_PNPM_OUTDATED_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up-to-date with package.json 

What does this mean and how do I fix it?

4 Answers 4

22

TL;DR just run pnpm install so it can update the lockfile.

This issue is caused by the PNPM package manager that Vercel uses if it's out of sync with NPM.

It happens when you are using both NPM and PNPM on your Next.js project.

Learn more about PNPM here: https://pnpm.io/

To fix this issue, sync npm and pnpm by running pnpm install and pushing the updated pnpm-lock.yaml file. You can also choose to remove your package-lock.json file if you want to completely switch to pnpm (it works mostly the same as npm with a few benefits (mainly no large node_modules folder)

Sign up to request clarification or add additional context in comments.

2 Comments

TL;DR just run pnpm install so it can update the lockfile.
if I do pnpm install the lock file doesn't change
3

Delete pnpm-lock.yaml file and push it into Github for Vercel to redeploy

Comments

0

Use this command and try to redeploy:

pnpm i --lockfile-only 

1 Comment

I would suggest to provide some details on the answer, e.g. 'why' this answers the question.
0

This is usually caused by a pnpm version mismatch between vercel and your lockfile.

# update your pnpm version pnpm add -g pnpm 
# update lockfile pnpm install 

Files should now be in sync and should deploy on push.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.