Skip to content

docs: Document npm_old_version and npm_new_version environment variables - #9385

Merged
owlstronaut merged 2 commits into
npm:latestfrom
36degrees:document-npm-version-env-vars
May 21, 2026
Merged

docs: Document npm_old_version and npm_new_version environment variables#9385
owlstronaut merged 2 commits into
npm:latestfrom
36degrees:document-npm-version-env-vars

Conversation

@36degrees

Copy link
Copy Markdown
Contributor

npm sets two additional environment variables npm_old_version and npm_new_version when running the preversion, version, postversion scripts, but these aren’t documented anywhere.

Document the variables in the ‘Scripts’ docs, and cross-reference them from the documentation for the version command (and the libnpmversion readme).

I've tried to match the existing formatting conventions for each document. Please let me know if anything needs to change.

npm sets two additional environment variables when running the `preversion`, `version`, `postversion` scripts, but these aren’t documented anywhere.
Document the variables in the ‘Scripts’ docs. This feels like the right place for these docs as it’s where the other environment variables are listed.
@owlstronautowlstronaut changed the title Document npm_old_version and npm_new_version environment variablesdocs: Document npm_old_version and npm_new_version environment variablesMay 21, 2026
@owlstronaut
owlstronaut merged commit d124c08 into npm:latestMay 21, 2026
21 of 22 checks passed
@github-actionsgithub-actionsBot mentioned this pull request May 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Backport to release/v11 created: #9389

owlstronaut pushed a commit that referenced this pull request May 21, 2026
…riables (#9389)
Backport of #9385 to `release/v11`.
Co-authored-by: Oliver Byford <oliver.byford@digital.cabinet-office.gov.uk>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@36degrees@owlstronaut