Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pnpm install --frozen-lockfile fails with pnpm 7 after upgrading lockfile to 6.1 from 6.0 #6609

Closed
ludofischer opened this issue May 29, 2023 · 12 comments

Comments

@ludofischer
Copy link

pnpm version: 7.32.5

Code to reproduce the issue:

cssnano/cssnano#1504

Expected behavior:

pnpm 7.x.x manages to install the dependencies when the lockfile version is 6.1,
since the major lockfile version did not change

Actual behavior:

pnpm fails and prints this error:

 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 6.0
Lockfile is up to date, resolution step is skipped
 ERR_PNPM_LOCKFILE_MISSING_DEPENDENCY  Broken lockfile: no entry for '/@changesets/cli/2.26.1' in pnpm-lock.yaml

This issue is probably caused by a badly resolved merge conflict.
To fix the lockfile, run 'pnpm install --no-frozen-lockfile'.

It is not even possible to downgrade the lockfile, because running pnpm --no-frozen-lockfile gives a different error:

 ERROR  /@babel/code-frame@7.18.6 is an invalid relative dependency path

Additional information:

  • node -v prints: v20.2.0
  • Windows, macOS, or Linux?: Linux
@hjaber
Copy link

hjaber commented May 30, 2023

downgrading to pnpm@8.5.1 solved this for me in the meantime

@yceffort
Copy link

I think old pnpm should also support installing lock file 6.1.
Since 6.1 is not a major version change, the installation should be fine.

@reeversedev2
Copy link

@hjaber I can confirm that by downgrading to pnpm@8.5.1 solved the issue for me as well.

@hyperscientist
Copy link

Can confirm that this is an issue and definitely a bug since it was only a minor version bump. I can't even publish default create-next-app template to Vercel.

@fdc-viktor-luft
Copy link

fdc-viktor-luft commented May 30, 2023

Also happens with that dependency:

ERR_PNPM_LOCKFILE_MISSING_DEPENDENCY  Broken lockfile: no entry for '/@apidevtools/swagger-parser/10.1.0(openapi-types@12.1.3)' in pnpm-lock.yaml

@sparanoid
Copy link

sparanoid commented May 30, 2023

Got exact the same error on Vercel after upgrading lockfile to 6.1:

Vercel CLI 29.3.6
--
03:03:47.647 | Detected `pnpm-lock.yaml` version 6.1 generated by pnpm 8...
03:03:47.656 | Installing dependencies...
03:03:48.200 | 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 6.0
03:03:48.212 | Lockfile is up to date, resolution step is skipped
03:03:50.644 | ERR_PNPM_LOCKFILE_MISSING_DEPENDENCY  Broken lockfile: no entry for '/@emotion/react/11.11.0(@types/react@18.2.7)(react@18.2.0)' in pnpm-lock.yaml
03:03:50.874 | BUILD_UTILS_SPAWN_1: Command "pnpm install" exited with 1

Downgrade to pnpm@8.5.1 and regenerate the lockfile works for me.

@zkochan
Copy link
Member

zkochan commented May 30, 2023

I'll try to port it to v7 later.
In the meantime, try to upgrade to v8 if you can.

@hosmelq
Copy link

hosmelq commented May 30, 2023

I am running pnpm@8.5.1 in the server and pnpm@8.6.0 in my local and having the same error.

@zkochan
Copy link
Member

zkochan commented May 31, 2023

There was a bug in the code that checks the version of the lockfile. That is why it fails. The version was changed to 6.1 and the code cannot detect it as v6. Update pnpm on the server to v8.6

@christianhg
Copy link

If you, like me, experienced this problem with a v6.1 lockfile on Vercel, then good news: Looks like they updated pnpm now, effectively resolving the issue.

@zkochan
Copy link
Member

zkochan commented May 31, 2023

🚢 7.33.0

for consistent install between v7 and v8 you also need to set auto-install-peers in .npmrc in the root of your project.
In v7 it is false by default while in v8 it is true. So if you use both, set the setting explicitly. Otherwise, pnpm install --frozen-lockfile will fail.

@zkochan zkochan closed this as completed May 31, 2023
byronogis added a commit to byronogis/npm-starter that referenced this issue Jul 14, 2023
byronogis added a commit to byronogis/npm-starter that referenced this issue Jul 14, 2023
byronogis added a commit to byronogis/unplugin-starter that referenced this issue Jul 15, 2023
@99tech-hamid-ali
Copy link

=> ERROR [stage0 3/3] RUN pnpm i --frozen-lockfile 1.2s

[stage0 3/3] RUN pnpm i --frozen-lockfile:
#0 1.097  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 6.0
#0 1.098 Lockfile is up to date, resolution step is skipped
#0 1.133  ERR_PNPM_LOCKFILE_MISSING_DEPENDENCY  Broken lockfile: no entry for '/@apollo/client/3.7.11(graphql@16.6.0)(react-dom@18.2.0)(react@18.2.0)' in pnpm-lock.yaml
#0 1.133
#0 1.133 This issue is probably caused by a badly resolved merge conflict.
#0 1.133 To fix the lockfile, run 'pnpm install --no-frozen-lockfile'.


Dockerfile:47

45 | # COPY ./bin/postinstall.js /app/bin/postinstall.js
46 | RUN npm install pnpm@8.1.1 -g
47 | >>> RUN pnpm i --frozen-lockfile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests