[v10 backport] fix(powershell): fix StrictMode and improve argument parsing #8551
Merged
wraithgar merged 3 commits intonpm:release/v10from Sep 30, 2025
alexsch01:v10
Merged
[v10 backport] fix(powershell): fix StrictMode and improve argument parsing #8551wraithgar merged 3 commits intonpm:release/v10from alexsch01:v10
wraithgar merged 3 commits intonpm:release/v10from
alexsch01:v10
Conversation
Fixes issue #8468: npm.ps1 and npx.ps1 fail on Windows PowerShell 5.1 when run in strict mode.
improve the argument parsing PS1 logic - support `& npm args` and `. npm args` properly - support syntax such as `C:\"Program Files"\nodejs\npm.ps1 args` **of course ^ for both npm and npx version of the script** Code Explanation: instead of getting the `CommandElements.Extent.Text` array and joining it with spaces right away, now it's getting the same array and only capturing everything after the first element
Contributor
Author
|
NodeJS 24.8.0 includes this fix, working great |
Contributor
Author
|
Since NodeJS 22.x is not certain about npm 11 (nodejs/node#58423), we should get this into npm 10 series at some point @wraithgar |
Contributor
Author
|
@owlstronaut sorry to ping but can this get into v10 branch? |
Member
|
@alexsch01 we hadn't forgotten about this, there are other PRs that were taking our attention and it didn't hurt to sit on this another few weeks to be extra sure things were working in |
wraithgar
approved these changes
Sep 30, 2025
Contributor
Author
|
thank you! |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
[v10 branch]
Cherry-picks of
5d82d0b
5f18557
dd4cee9