Commit db67e9b
fix(cli): strip trailing slash from registry URL in install script (#916)
## Summary
Fixes the Windows install script failing with a 404 error when the
user's npm registry URL has a trailing slash (e.g.,
`https://registry.npmmirror.com/`).
The trailing slash causes a double slash in the constructed URL
(`https://registry.npmmirror.com//pnpm/latest`), which returns 404. The
install shell scripts (`install.ps1` and `install.sh`) already strip
trailing slashes for their own URL construction, but the Rust binary
(`vp.exe`) reads `NPM_CONFIG_REGISTRY` directly from the environment
without stripping.
**Fix:** Strip trailing slashes from the registry URL in two places:
- `EnvConfig::from_env()` — where the registry URL is read from
environment variables (affects all commands)
- `resolve_version()` — where a registry override parameter is used for
upgrades
Fixes #904
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 90a23d5 commit db67e9b
2 files changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
| |||
0 commit comments