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

prepublishOnly was executed twice when publish #2941

Closed
VitorLuizC opened this issue Oct 20, 2020 · 7 comments · Fixed by #5956
Closed

prepublishOnly was executed twice when publish #2941

VitorLuizC opened this issue Oct 20, 2020 · 7 comments · Fixed by #5956
Assignees
Milestone

Comments

@VitorLuizC
Copy link

pnpm version: 5.9.3

Code to reproduce the issue:

pnpm publish -r

Expected behavior:

prepublishOnly of each package is executed once before publishing.

Actual behavior:

prepublishOnly of each package is executed twice before publishing.

Additional information:

  • node -v prints: v14.14.0
  • Windows, OS X, or Linux?: Windows with WSL (Ubuntu).
@PabloSzx
Copy link
Member

PabloSzx commented Mar 15, 2021

any workaround to this?

@zkochan sorry for tagging, I could help to fix this if given some advice

@zkochan
Copy link
Member

zkochan commented Mar 15, 2021

This code is in https://github.com/pnpm/pnpm/blob/main/packages/plugin-commands-publishing/src/recursivePublish.ts

if it executes twice, maybe npm publish ignores the --ignore-scripts option.

@PabloSzx
Copy link
Member

npm/cli#2755 It seems to be an issue with npm 😞

@zkochan
Copy link
Member

zkochan commented Mar 16, 2021

Indeed, this is a regression in npm v7. Use npm v6 for now.

@styfle
Copy link

styfle commented Oct 17, 2022

I believe the issue might be related to pnpm pack running the prepublishOnly script when it should not

@rafaelliu
Copy link

@styfle is probably right, came here to file an issue about that. OP's issue is probably a consequence to prepublishOnly being executed during pack.

Here's what I'm seeing:

❯ pnpm pack

> mypkg@0.0.0 prepublishOnly <$PWD>
> echo prepublishOnly executed

prepublishOnly executed

> mypkg@0.0.0 prepack <$PWD>
> echo prepack executed

prepack executed
mypkg-0.0.0.tgz

@zkochan
Copy link
Member

zkochan commented Jan 15, 2023

ok, it should be fixed.

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

Successfully merging a pull request may close this issue.

5 participants