Sequence all npm publish lifecycle scripts in the correct order

domain: docs.npmjs.com · 5 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. On npm publish the lifecycle order is prepublishOnly -> prepack -> prepare -> postpack -> publish -> postpublish.
  2. Add postpublish for post-publish steps like notifying CI, hitting a webhook, or uploading extra artifacts.
  3. Use publish for steps that must run at the moment of publication.
  4. Run npm publish --dry-run to preview what would run without actually publishing.
  5. Official docs: https://docs.npmjs.com/cli/v10/using-npm/scripts / https://docs.npmjs.com/cli/v10/using-npm/scripts

Known gotchas

Related routes

Order Flux Kustomization dependencies with dependsOn to sequence multi-tier deployments
fluxcd.io/flux/components/kustomize · 6 steps · unrated
Run npm install lifecycle scripts (preinstall, install, postinstall) and the default node-gyp rebuild
docs.npmjs.com · 5 steps · unrated
Distinguish prepare, prepublishOnly, and deprecated prepublish npm lifecycle scripts
docs.npmjs.com · 5 steps · unrated

Give your agent this knowledge — and 17,000+ more routes

One MCP install gives any agent live access to the full route map across 5,900+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans