-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[BUG] postpack script runs BEFORE the tarball has been generated and moved to its final destination. #2220
Comments
what version of node? what version of npm? some key pieces of our issue template are missing here, but I'm unable to reproduce this in npm@7.0.13 |
If you check the source will see that, libnpmpack is called here: Line 41 in 65bdbb2
which calls post pack life cycle script here: https://github.com/npm/libnpmpack/blob/c4f8b823e9f206113bef3e59419f7aa93c619acb/index.js#L33 and then the file will be written here: Line 45 in 65bdbb2
|
indeed! good find, thanks for reporting it! |
IMHO one easy fix will be to conditionally of dryrun pass the output path to the libnpmpack method as parameter so it could write the file if the path is not null/undefined between the pre and post pack life cycle scripts execution. |
BTW Which is another problem as it breaks my postpack hooks to cleanup package.json content on |
Still not working on node v16.13.0. |
I updated my project from npm 6.14.13 (node.js 14.17.1) to npm 8.4.1 (node.js 16.13.2), and am also running into this issue. I have a 'prepack' script to run eslint and unit tests, and I have a 'postpack' script to move the packaged tarball into a different folder. After upgrading npm and running According to the npm documentation |
this is fixed in npm@8.5.0, which was just published today. thanks for your patience on this one folks! |
Current Behavior:
postpack script runs BEFORE the tarball has been generated and moved to its final destination.
Expected Behavior:
As is in the documentation:
Runs AFTER the tarball has been generated and moved to its final destination.
Steps To Reproduce:
copy this package.json to an empty directory
run:
npm pack
and then
ls -al
Environment:
*nix
The text was updated successfully, but these errors were encountered: