pnpm: "Broken lockfile: no entry for" when 'pnpm install --no-optional'
pnpm version:
6.32.3
Code to reproduce the issue:
package.json and pnpm-lock.yaml at https://gist.github.com/MBelniak/e9a14fcc72e20b2e0355aa3b25278eec
pnpm install --no-optional
and also, then:
pnpm install --no-optional --no-frozen-lockfile
Expected behavior:
Lockfile is fixed after adding ‘–no-frozen-lockfile’ or more appropriate hint is displayed.
Actual behavior:
Lockfile is not fixed, the same error and hint are displayed.
Lockfile is up-to-date, resolution step is skipped
WARN Broken lockfile: no entry for '/uglify-js/3.8.1' in pnpm-lock.yaml
ERR_PNPM_ERR_PNPM_LOCKFILE_MISSING_DEPENDENCY The lockfile is broken! Resolution step will be performed to fix it.
WARN deprecated @types/redux@3.6.0: This is a stub types definition for Redux (https://github.com/reactjs/redux). Redux provides its own type definitions, so you don't need @types/redux installed!
WARN deprecated @stylelint/postcss-markdown@0.36.2: Use the original unforked package instead: postcss-markdown
optionalDependencies: skipped
WARN Issues with peer dependencies found
.
├─┬ @typescript-eslint/eslint-plugin
│ └── ✕ missing peer @typescript-eslint/parser@^4.0.0
├─┬ postcss-loader
│ └── ✕ missing peer postcss@"^7.0.0 || ^8.0.1"
└─┬ ts-jest
└── ✕ missing peer jest@">=26 <27"
Peer dependencies that should be installed:
@typescript-eslint/parser@^4.0.0 jest@">=26 <27" postcss@"^7.0.0 || ^8.0.1"
ERR_PNPM_LOCKFILE_MISSING_DEPENDENCY Broken lockfile: no entry for '/uglify-js/3.8.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'.
Progress: resolved 1115, reused 1115, downloaded 0, added 0
Additional information:
Removing --no-optional
fixes this issue.
node -v
prints: v14.15.4- Windows, macOS, or Linux?: Linux
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 8
- Comments: 18 (3 by maintainers)
I encountered the same issue, just manually adding the missing dependency to your package.json and
pnpm install
again solves the issue apparently.In my case the error message was:
So I open
pnpm-lock.yaml
and searchwebpack@4.46.0
then I noticed the packagenext-fonts
was the one needing that dependency, so I opened thepackage.json
where I am usingnext-fonts
in my monorepo and added thatwebpack@4.46.0
dep there.Finally
pnpm install
and pnpm no longer complains about that. Note: tested with--prod
and--no-optional
. I am also usingnode-linker=hoisted
. In all those cases it works fine.I’m having this issue as well, pnpm complains about not finding a dep on the lock file but the lock file has that dependency. It only happens when installing packages using the -P/–prod flag. I’m using the
node-linker=hoisted
option by the way.@zkochan
I have the same issue, I need to enable the
node-linker=hoisted
option because of the facebook/metro issue. But when I enable this option, I get this error.Just had this issue on CI after upgrading pnpm: https://github.com/hybridly/hybridly/actions/runs/5232083721/jobs/9446623775
The same error with
node-linker=hoisted
&pnpm i --no-optional --frozen-lockfile
. Is there any news?i have the same question.when i use pnpm 7.4.0 and this commder
pnpm --filter=xxx deploy dist
error isERR_PNPM_LOCKFILE_MISSING_DEPENDENCY Broken lockfile: no entry for '/sass/1.53.0' in pnpm-lock.yaml