docs: add PATH fix instructions to installation troubleshooting#1459
Conversation
🛫 PR Readiness Check
PR Scope: 🔧 Infrastructure
|
| Status | Check | Details |
|---|---|---|
| ✅ | Single commit | 1 commit — clean history |
| ✅ | Not in draft | Ready for review |
| ❌ | Branch up to date | dev is 17 commit(s) ahead — rebase recommended |
| ❌ | Copilot review | No Copilot review yet — it may still be processing |
| ✅ | Changeset present | No source files changed — changeset not required |
| ✅ | Scope clean | No .squad/ or docs/proposals/ files |
| ✅ | No merge conflicts | No merge conflicts |
| ✅ | Copilot threads resolved | 0 active Copilot thread(s) resolved (2 outdated skipped) |
| ❌ | CI passing | 4 check(s) still running |
Files Changed (1 file, +65 −5)
| File | +/− |
|---|---|
docs/src/content/docs/get-started/installation.md |
+65 −5 |
Total: +65 −5
This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.
🟢 Impact Analysis — PR #1459Risk tier: 🟢 LOW 📊 Summary
🎯 Risk Factors
📦 Modules Affecteddocs (1 file)
This report is generated automatically for every PR. See #733 for details. |
There was a problem hiding this comment.
Pull request overview
Updates the installation troubleshooting docs to give actionable, platform-specific steps for resolving squad: command not found when the npm global install location isn’t on PATH, addressing the gap described in issue #1458.
Changes:
- Adds a step-by-step troubleshooting flow (confirm install → find global prefix → update PATH → verify).
- Documents how to locate the global prefix with
npm prefix -gand where thesquadbinary is expected to live on macOS/Linux vs Windows. - Provides platform-specific PATH update instructions using shell profiles (macOS/Linux) and PowerShell (Windows).
| Run this in PowerShell to permanently add the npm global directory to your user PATH: | ||
|
|
||
| ```powershell | ||
| [Environment]::SetEnvironmentVariable("PATH", $env:PATH + ";" + (npm prefix -g), "User") |
| Then reload your shell: | ||
|
|
||
| ```bash | ||
| source ~/.bashrc # or ~/.zshrc |
|
Thanks for the improved docs structure — the step-by-step approach is much better than the old 'check your PATH' stub. One blocking issue with the Windows PowerShell command: \\powershell Current (buggy):[Environment]::SetEnvironmentVariable("PATH", $env:PATH + ";" + (npm prefix -g), "User") \\C:\Program Files\PowerShell\7;C:\Users\tamirdresher\AppData\Local\Programs\GitHub Copilot;C:\Users\tamirdresher\AppData\Local\github-copilot-git-2.53.0-3\cmd;C:\Users\tamirdresher\AppData\Local\github-copilot-git-2.53.0-3\mingw64\bin;C:\Users\tamirdresher\AppData\Local\github-copilot-git-2.53.0-3\mingw64\usr\bin;C:\Users\tamirdresher\AppData\Local\copilot-desktop-gh-2.96.0;C:\Program Files\Microsoft\jdk-21.0.10.7-hotspot\bin;C:\Program Files\Microsoft\jdk-17.0.18.8-hotspot\bin;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:.Tools\agency\CurrentVersion;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\Azure Dev CLI;C:\Program Files\GitHub CLI;C:\Program Files\Microsoft SQL Server\170\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files\Microsoft VS Code\bin;C:.tools\dotnet;C:.tools.npm-global;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\Microsoft SQL Server\160\DTS\Binn;C:\Users\vmadmin\AppData\Local\Microsoft\WindowsApps;c:\nvm;C:\Program Files\nodejs;C:\ES.DevProd\SpringBoard\SBCli\SpringBoardCli;C:\Program Files\GVFS;C:\ES.DevProd\VMSetupScripts;C:\ProgramData\global-npm;C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft Dev Box Agent\Scripts;C:\Program Files\dotnet;C:\Program Files\Go\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files\Git\cmd;C:\Program Files\PowerShell\7;C:\Users\tamirdresher.cargo\bin;C:\Ruby32\bin;C:\Ruby33\bin;C:\Ruby330\bin;C:\Ruby330-x64\bin;C:\Users\tamirdresher\AppData\Local\Programs\Python\Python312\Scripts;C:\Users\tamirdresher\AppData\Local\Programs\Python\Python312;C:\Users\tamirdresher\AppData\Local\Programs\Python\Launcher;C:\Users\tamirdresher\AppData\Local\Microsoft\WindowsApps;C:\Users\tamirdresher\AppData\Local\Microsoft\WinGet\Links;C:\Users\tamirdresher.dotnet\tools;C:\Users\tamirdresher.azure-kubectl;C:\Users\tamirdresher.azure-kubelogin;C:\Users\tamirdresher\go\bin;C:\Users\tamirdresher\AppData\Local\Programs\AzureAuth\0.9.6\\ contains the combined Machine + User PATH entries (inherited at shell startup). Writing that back to the User registry key permanently duplicates all Machine-level paths into User PATH, bloating and corrupting it. Fix: This reads only the existing User-scoped PATH before appending. Minor suggestion: a brief caveat for nvm/fnm users (their npm prefix points to a shim directory) would prevent follow-up support issues. |
tamirdresher
left a comment
There was a problem hiding this comment.
Two blocking issues in the "squad: command not found" section — please address both.
1. Windows PowerShell snippet corrupts User PATH
Under Windows (PowerShell) the snippet reads $env:PATH and writes it back to the User scope:
[Environment]::SetEnvironmentVariable("PATH", $env:PATH + ";" + (npm prefix -g), "User")$env:PATH is the process PATH (Machine PATH + User PATH merged at shell startup). Writing it back to the User scope permanently duplicates every Machine entry into the User PATH. Repeat runs also duplicate npm prefix -g. Over time this bloats User PATH toward the 8191-char registry limit and can corrupt it.
Please read only the User scope and dedup before appending:
$npmPrefix = (npm prefix -g).Trim()
$userPath = [Environment]::GetEnvironmentVariable("PATH", "User")
if (-not (($userPath -split ';') -contains $npmPrefix)) {
$newUserPath = if ([string]::IsNullOrEmpty($userPath)) { $npmPrefix } else { $userPath.TrimEnd(';') + ";" + $npmPrefix }
[Environment]::SetEnvironmentVariable("PATH", $newUserPath, "User")
}2. Shell-reload line is labelled for two shells but only runs one
Under macOS / Linux the reload step says:
source ~/.bashrc # or ~/.zshrc
That literally sources ~/.bashrc even when the user's shell is zsh — the # or ~/.zshrc is only a comment. Please give two genuinely separate commands so users pick the right one:
# Bash
source ~/.bashrc# Zsh
source ~/.zshrcOnce these two are fixed I'll re-review.
|
Thanks @tamirdresher — addressed both blocking items plus your nvm/fnm suggestion in 1. Windows PowerShell PATH corruption — the snippet now reads only the $npmPrefix = (npm prefix -g).Trim()
$userPath = [Environment]::GetEnvironmentVariable("PATH", "User")
if (-not (($userPath -split ';') -contains $npmPrefix)) {
$newUserPath = if ([string]::IsNullOrEmpty($userPath)) { $npmPrefix } else { $userPath.TrimEnd(';') + ";" + $npmPrefix }
[Environment]::SetEnvironmentVariable("PATH", $newUserPath, "User")
}2. Shell-reload step — split into two genuinely separate Bash and Zsh commands instead of sourcing Bonus — added a Docs build + build-output tests pass locally. Ready for re-review. |
Expand the `squad: command not found` troubleshooting section with actionable, platform-specific steps for getting the npm global bin directory onto PATH: - Confirm the install, locate the global prefix with `npm prefix -g`, update PATH, and verify. - macOS/Linux: add the export line to a shell profile, with separate Bash (`source ~/.bashrc`) and Zsh (`source ~/.zshrc`) reload commands. - Windows (PowerShell): append the npm prefix to the User-scoped PATH, reading only the User scope and deduping so repeated runs don't duplicate entries or copy Machine-level paths into User PATH. - Add an nvm/fnm caveat noting `npm prefix -g` points to a version-specific directory. Closes bradygaster#1458 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
8255dda to
ee6ebc4
Compare
tamirdresher
left a comment
There was a problem hiding this comment.
Approving. Head verified at ee6ebc489fcd87942232439f8eb127705bba0608, checks are green, and the previously requested blockers are all addressed: Windows PowerShell now updates only the User-scoped PATH ([Environment]::GetEnvironmentVariable("PATH","User")), duplicates are prevented (-notcontains $npmPrefix), whitespace is trimmed on the read and the trailing ; is stripped, bash and zsh have separate code blocks, and there is now explicit nvm/fnm guidance. This new APPROVE explicitly supersedes my earlier CHANGES_REQUESTED from 2026-07-13. Not merging — leaving that to maintainers.
The troubleshooting section for
squad: command not foundpreviously told users to check their PATH but didn't explain how to actually fix it when the npm global prefix directory isn't in PATH.This adds platform-specific instructions for:
npm prefix -gFixes #1458