pnpm icon indicating copy to clipboard operation
pnpm copied to clipboard

pnpm --filter pkg1 add dep not update pkg1's package.json when postinstall in root package.json failed in pnpm workspace

Open liuwenzhuang opened this issue 4 months ago • 0 comments

Verify latest release

  • [X] I verified that the issue exists in the latest pnpm release

pnpm version

No response

Which area(s) of pnpm are affected? (leave empty if unsure)

CLI

Link to the code that reproduces this issue or a replay of the bug

No response

Reproduction steps

  1. create a pnpm workspace project, add a child package which name like pkg1
  2. add a failed postinstall script in root package.json, like postinstall: exit 1
  3. add dep to child package, like pnpm --filter pkg1 add lodash

Describe the Bug

the pkg1's package.json not update because postintall in root package.json failed, but the pnpm-lock.yaml has updated

Expected Behavior

the pkg1's package.json is update, not affected by lifecycles like postintall in root package.json

Which Node.js version are you using?

20.10.0

Which operating systems have you used?

  • [ ] macOS
  • [ ] Windows
  • [X] Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

Ubuntu

liuwenzhuang avatar Oct 10 '24 03:10 liuwenzhuang