fix(cli): strip trailing slash from registry URL in install script#916
Merged
fengmk2 merged 1 commit intovoidzero-dev:mainfrom Mar 16, 2026
Merged
Conversation
When the npm registry URL has a trailing slash (e.g., `https://registry.npmmirror.com/`), URL concatenation produces a double slash (`https://registry.npmmirror.com//pnpm/latest`) which returns 404. Strip trailing slashes from the registry URL in EnvConfig::from_env() and in the upgrade registry resolver to prevent this. Fixes voidzero-dev#904 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
✅ Deploy Preview for viteplus-preview canceled.
|
fengmk2
approved these changes
Mar 16, 2026
Member
|
@zerone0x Thanks! |
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.
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.ps1andinstall.sh) already strip trailing slashes for their own URL construction, but the Rust binary (vp.exe) readsNPM_CONFIG_REGISTRYdirectly 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 upgradesFixes #904