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

Postinstall scripts are now always run after pnpm install is ran #7268

Closed
mattlewis92 opened this issue Nov 1, 2023 · 8 comments · Fixed by #7270
Closed

Postinstall scripts are now always run after pnpm install is ran #7268

mattlewis92 opened this issue Nov 1, 2023 · 8 comments · Fixed by #7270
Assignees

Comments

@mattlewis92
Copy link

Last pnpm version that worked

8.9.2

pnpm version

8.10.0

Code to reproduce the issue

I can reproduce this on any repo that uses pnpm with dependencies with postinstall scripts:

gh repo clone mattlewis92/angular-calendar
corepack enable
pnpm i
pnpm i # Observe how all dependencies postinstall scripts are re-ran

If you revert back to pnpm 8.9.2 here, then you'll see the bug is fixed:

https://github.com/mattlewis92/angular-calendar/blob/5477127c428391a0b0086da2126035ea001b5cff/package.json#L8

Expected behavior

Postinstall scripts are not ran when repeatedly running pnpm install

Actual behavior

Postinstall scripts are always ran, regardless if nothing changed. This leads to slow performance

Additional information

No response

Node.js version

20.6.1

Operating System

macOS

@JonoPrest
Copy link

Hi there,

My team is also encountering this issue and it is a breaking change for our code-generator product that we are building.

We build in the Rescript/Ocaml eco system and rely on a lot of PPX binaries that all have postinstall scripts and break when the postinstall script gets rerun usually since the binary has already been moved. For example using this package:

https://github.com/rescript-association/genType

@zkochan
Copy link
Member

zkochan commented Nov 1, 2023

I'll look into it.

@zkochan
Copy link
Member

zkochan commented Nov 1, 2023

Looks like it was caused by this PR: #7214.
I don't know why yet.

@JonoPrest
Copy link

I'll look into it.

Thanks so much 🙏🏼

@zkochan
Copy link
Member

zkochan commented Nov 1, 2023

I'll release a fix today.

@mattlewis92
Copy link
Author

Wow, that was so fast. Thank you for the quick patch, it's really appreciated! ❤️

@JonoPrest
Copy link

Thanks for the amazingly fast patch. Much appreciated 🙏🏼

@andreifilip123
Copy link

Hello. This is still happening to me on pnpm 8.15.3. Any tips on how to debug why ?

Node.js version
20.11.1

Operating System
macOS 14.3 (Sonoma)

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

Successfully merging a pull request may close this issue.

4 participants