GeezerVison is showing github.com — fix: pass script-shell to publish lifecycle hooks by Zelys-DFKH · Pull Request #9492 · npm/cli
Conversation
Zelys-DFKH
commented
Jun 4, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
npm run passes script-shell to @npmcli/run-script, but the three runScript() calls in publish.js for prepublishOnly, publish, and postpublish never did. On Windows, where users set script-shell to bash in .npmrc, lifecycle hooks still ran under cmd.exe, while explicit npm run calls used the configured shell. The fix reads script-shell from config in #publish() and passes it to all three calls, matching the pattern in run.js.
Fixes #9477
Credit: @wiggisser's analysis in #9477.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
npm run passes script-shell to @npmcli/run-script, but the three
runScript() calls in publish.js for prepublishOnly, publish, and
postpublish never did. On Windows, where users set script-shell to
bash in .npmrc, those lifecycle hooks still ran under cmd.exe while
explicit npm run calls used the configured shell.
Reads script-shell from config in #publish() and passes it to all
three calls, matching the existing pattern in run.js. Adds script-shell
to static params so it appears in npm help publish.
Fixes npm#9477
Uh oh!
There was an error while loading. Please reload this page.
|
🎉 Backport to release/v11 created: #9499
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.