0

I have a project that defines a postpublish action in its package.json. I now have a use case where I want to execute publish without executing the postpublish action.

Is there a reliable way I can execute the publish action completely, so it does not trigger the postpublish action?

Herr Derb
  • 4,977
  • 5
  • 34
  • 62

1 Answers1

0

The --dry-run flag works for npm install and also for npm publish & npm pack if the CLI version is at npm@6.0.0

If you cannot operate NPM at v6, the tool "Irish Pub" might be exactly what you're looking for to do an npm publish dry run: https://www.npmjs.com/package/irish-pub

Victor
  • 868
  • 1
  • 9
  • 24
  • It's not exactly what I'm looking for. I would like to execute the `publish` goal completely, but not to trigger the post hock `postpublish` – Herr Derb Jun 13 '19 at 06:38
  • Precisely what you want to do (actually run publish but not the postpublish "hook") is not possible from any conventional uses of npm. I'm curious about your use-case/requirements for this behavior, but if it must be done see here for a discussion about modifying the package.json itself when running script: https://stackoverflow.com/a/48823116/3191929 – Victor Jun 14 '19 at 14:19