fix(installer): Node version check fails under Windows PowerShell 5.1 - #8235
Open
JohnMcLear wants to merge 3 commits into
Open
JohnMcLear wants to merge 3 commits into
JohnMcLear wants to merge 3 commits into
Conversation
Refs #8214. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0139nGyeFNACmifj6pRLSVRs
…ression) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0139nGyeFNACmifj6pRLSVRs
…l 5.1)
Windows PowerShell 5.1 strips embedded double quotes from native-command
arguments, so `node -p 'process.versions.node.split(".")[0]'` reached
node as split(.)[0], threw a SyntaxError, cast to 0, and aborted with
'Node.js >= 24 required' for any Node version.
Fixes #8214
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139nGyeFNACmifj6pRLSVRs
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoFix Node version detection in Windows PowerShell 5.1
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can enable the Remediation agent and Qodo fixes findings in a dedicated fix PR |
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.
Fixes #8214
Root cause
Not the pnpm 12
pnpm ls --no-productioncrash fixed in #8232/3.3.5, which is a different failure. The Windows installer checked the Node version with:Windows PowerShell 5.1, the default
PS C:\>shell on Windows 10/11 and the oneinstaller.ps1declares support for via#Requires -Version 5.1, strips embedded double quotes when it passes arguments to native executables. So node receivedprocess.versions.node.split(.)[0]and threw aSyntaxError. The empty output cast to0, so the installer aborted withNode.js >= 24 required. You have v26.8.2.for every Node version. PowerShell 7 (pwsh) passes the quotes correctly. CI only ran the installer underpwsh, so this never showed up there.Fix
bin/installer.ps1: parsenode --version(v24.15.0) with a PowerShell regex instead of passing a JS snippet tonode -p. This removes the quoting problem entirely. If the version can't be parsed, the installer now says so instead of reporting a misleading "too old"..github/workflows/installer-test.yml: the Windows end-to-end job is now a matrix overpwshandpowershell(Windows PowerShell 5.1).shell:can't take an expression, so the step is split per shell.Tests / evidence
windows-latest, powershellleg failed with the exact error from the issue (run 35215567068):/apismoke test. See the checks on this PR.No docs change is needed because the install command is unchanged.
🤖 Generated with Claude Code
https://claude.ai/code/session_0139nGyeFNACmifj6pRLSVRs