Commit 690b193
committed
🐛 fix(windows): remove broken fnm use --lts + catch silent npm failures
Observed on a fresh Windows 11 install test:
- `fnm use --lts` fails on recent fnm builds from winget with "unexpected
argument '--lts' found". Because PowerShell does not halt on native
command non-zero exit codes under $ErrorActionPreference = "Stop", the
script continued past the error. `fnm install --lts` already activates
the version in the current shell's multishell junction, so the follow-up
call was both redundant and broken. Removed.
- `npm install -g @anthropic-ai/claude-code` produced no visible output and
`Need claude` threw with a confusing "Missing command: claude" message.
Two fixes:
1. Re-activate fnm (`fnm env --use-on-cd --shell powershell | iex`)
immediately before each `npm install -g` call so the multishell
junction is guaranteed to be on PATH even after earlier winget calls.
2. Check $LASTEXITCODE after the npm install and throw a clear error
when it's non-zero, so silent failures surface immediately instead
of cascading to a misleading "Missing command" message one section
later.1 parent 5f142e8 commit 690b193
2 files changed
Lines changed: 31 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
11 | 18 | | |
12 | 19 | | |
13 | 20 | | |
| |||
52 | 59 | | |
53 | 60 | | |
54 | 61 | | |
55 | | - | |
| 62 | + | |
| 63 | + | |
56 | 64 | | |
57 | 65 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | | - | |
154 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
155 | 157 | | |
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
159 | | - | |
| 161 | + | |
| 162 | + | |
160 | 163 | | |
161 | 164 | | |
162 | 165 | | |
| |||
195 | 198 | | |
196 | 199 | | |
197 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
198 | 207 | | |
199 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
200 | 212 | | |
201 | 213 | | |
202 | 214 | | |
203 | 215 | | |
204 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
205 | 220 | | |
206 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
207 | 225 | | |
208 | 226 | | |
209 | 227 | | |
| |||
0 commit comments