Document that it is not safe to run pinst in the prepack step #24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As much discussed in other issues,
"prepack": "pinst --disable"
has never worked as intended. It always results in wrong information going into the npm database. It's just that most tools ignored the wrong information, including npm before npm v10.4.0. See https://gist.github.com/djcsdy/3ca078e23fdac4c50e077c84e8284a95A lot of projects are starting to get hit by this problem:
postinstall
hook react-hookz/deep-equal#269I assume this is just the tip of the iceberg. EVERY historical package that has been published using pinst in the recommended configuration is broken and cannot be installed correctly by npm >= 10.4. This problem is NOT limited to packages that were published recently.
I am seeing a lot of confusion about the underlying cause, which is not really surprising.
I think the only responsible course of action is to immediately stop recommending that developers use pinst in their
prepack
andpostpack
scripts since this results in broken packages and always has done.Unfortunately the only safe way I know of to run pinst is to run it BEFORE
yarn publish
. There's no safe way I know of to causeyarn publish
to runpinst --disable
automatically. It's unfortunate that the solution is so unergonomic, but the only alternative is many broken packages.Fixes #22, #23.