vercel icon indicating copy to clipboard operation
vercel copied to clipboard

Vercel doesn't seem to run pnpm with v7 in CI

Open mcmxcdev opened this issue 2 years ago • 10 comments

pnpm changed from lockfileVersion: 5.3 to lockfileVersion: 5.4 in v7.

I redeployed without cache but there is still a warning in the pipeline like this:

08:37:34.173 | Installing build runtime...
08:37:36.081 | Build runtime installed: 1.907s
08:37:37.425 | No Build Cache available
08:37:37.735 | Running "install" command: `pnpm install`...
08:37:38.329 | Scope: all 7 workspace projects
08:37:38.448 | WARN  Your pnpm-lock.yaml was generated by a newer version of pnpm. It is a compatible version but it might get downgraded to version 5.3
08:37:38.449 | Lockfile is up-to-date, resolution step is skipped

pnpm v6 and v7 differs quite a bit so installing with the older version could lead to issues.


UPDATE on 7th August: When fixing the issue, it would be great if the Vercel team could make sure not only to check for a string of lockFileVersion: 5.4 but rather if the string includes that part. This is important because the value can also be lockfileVersion: 5.4-inlineSpecifiers when use-inline-specifiers-lockfile-format is enabled with was part of this release: `https://github.com/pnpm/pnpm/releases/tag/v7.7.0

mcmxcdev avatar Jun 29 '22 06:06 mcmxcdev

The version that currently runs on Vercel is 7.1.7, which is still quite out of date (I need pnpm patch support which was only added in 7.4.0). It would be nice if Vercel was to read the version from packageManager field in package.json.

Dremora avatar Jul 07 '22 16:07 Dremora

As workaround we specified a custom install command in Vercel UI now as npm i [email protected] -g, should help you with the patching ;)

Just a workaround though, not how it's supposed to behave.

mcmxcdev avatar Jul 07 '22 19:07 mcmxcdev

Please try out corepack https://vercel.com/changelog/corepack-experimental-is-now-available

It lets you select a specific pnpm version which should solve this issue, thanks!

styfle avatar Aug 07 '22 17:08 styfle

Please try out corepack vercel.com/changelog/corepack-experimental-is-now-available

Thanks, that is another way to work around the issue I guess!

mcmxcdev avatar Aug 07 '22 18:08 mcmxcdev

@styfle the corepack approach didn't work for some reason. Specifying custom install command npm i [email protected] -g && pnpm install did work however

tonyxiao avatar Oct 28 '22 17:10 tonyxiao

@tonyxiao Did you add ENABLE_EXPERIMENTAL_COREPACK=1 to your Project's Environment Variables?

styfle avatar Oct 30 '22 19:10 styfle

@styfle yep added it. In the end I did something like npm i [email protected] -g which worked.

tonyxiao avatar Nov 01 '22 14:11 tonyxiao

There's an extra step of setting the "packageManager" that I missed, now it works.

It lets you select a specific pnpm version which should solve this issue, thanks!

In a monorepo context, setting this value in the root package.json was enough it seems.

eric-burel avatar Nov 09 '22 08:11 eric-burel

pnpm 8 still not install dependencies.In thhe local works well.vercel not install dependencies.

terwer avatar Jun 05 '23 18:06 terwer

Why does Vercel still not use a pnpm version that supports pnpm patch by default in 2024?

Patches just silently not apply, which is very confusing.

phgn0 avatar Mar 05 '24 17:03 phgn0