GeezerVison is showing github.com — Upgrade failed · Issue #3422 · voidzero-dev/vite-plus
Activitynaokihaba commented on Nov 10, 2026 I investigated this issue and made a reproduction at https://github.com/naokihaba/vite-plus-issue-3422. The aliyun mirror returns 403 for requests without a User-Agent header. vp sends its Node.js download requests without this header. This causes the error.
My first hypothesis was that the mirror had not synced Node.js 24.22.2 yet. This is not the cause. The mirror lists v24.22.2/SHASUMS256.txt with the timestamp 2026-10-29 02:35, UTC+8. nodejs.org sends Last-Modified: Wed, 28 Oct 2026 18:35:19 GMT for the same file. Both timestamps are the same time. The reporter opened this issue on 2026-11-10, 12 days later.
https://mirrors.aliyun.com/nodejs-release/v24.22.2/
My second hypothesis was that the mirror blocks requests without a User-Agent header. This is the cause. curl with its default User-Agent gets 200. curl -H 'User-Agent:' gets 403 on 5 out of 5 requests. vp_shared::shared_http_client in crates/vp_shared/src/http.rs does not set a User-Agent, and reqwest does not send one by default. I also ran a local mirror that logs request headers. It shows that vp sends GET /v24.22.2/SHASUMS256.txt with no User-Agent.
vp upgrade installs the dependencies of the new release with the Node.js version in vpNodeVersion. The platform package metadata has this field. curl -s https://registry.npmjs.org/@voidzero-dev%2Fvite-plus-cli-darwin-arm64/1.5.1 | jq .vpNodeVersion returns "24.22.2". The upgrade does not use the Node.js that vp env manages, which is 24.15.0 in this report. If the runtime cache does not contain 24.22.2, vp downloads it from VP_NODE_DIST_MIRROR.
With VP_NODE_DIST_MIRROR=https://mirrors.aliyun.com/nodejs-release, vp upgrade from 1.5.0 to 1.5.1 fails with the same 403 Forbidden error as this report. A local mirror that rejects requests without a User-Agent gives the same error. Without VP_NODE_DIST_MIRROR, vp uses nodejs.org, and the upgrade succeeds. naokihaba commented on Nov 10, 2026 I also checked other Node.js mirrors in China. I am not familiar with these mirrors, so I asked an AI assistant to list them. I sent a request without a User-Agent header to v24.22.2/SHASUMS256.txt on each mirror. Only aliyun returns 403.
| Mirror |
Without User-Agent |
https://mirrors.aliyun.com/nodejs-release |
403 |
https://npmmirror.com/mirrors/node |
200 |
https://mirrors.tuna.tsinghua.edu.cn/nodejs-release |
200 |
https://mirrors.ustc.edu.cn/node |
200 |
https://mirrors.huaweicloud.com/nodejs |
200 |
https://mirrors.cloud.tencent.com/nodejs-release |
200 |
With VP_NODE_DIST_MIRROR=https://npmmirror.com/mirrors/node, vp upgrade from 1.5.0 to 1.5.1 succeeds with the same 1.5.0 binary.
Script
(
set -e
export VP_HOME="$(mktemp -d)"
export VP_SELF_SETUP_NO_MODIFY_PATH=1
trap 'rm -rf -- "$VP_HOME"' EXIT
unset VP_NODE_DIST_MIRROR
# 1. Install vp 1.5.0
curl -fsSL https://vite.plus | VP_VERSION=1.5.0 bash >/dev/null
export PATH="$VP_HOME/bin:$PATH"
vp --version | head -1
# 2. Remove the cached Node.js to match the reporter's state
rm -rf -- "$VP_HOME/js_runtime/node/"[0-9]*
# 3. Upgrade through aliyun (fails with 403)
VP_NODE_DIST_MIRROR=https://mirrors.aliyun.com/nodejs-release vp upgrade 1.5.1 || true
# 4. Upgrade through npmmirror (succeeds)
VP_NODE_DIST_MIRROR=https://npmmirror.com/mirrors/node vp upgrade 1.5.1
vp --version | head -1
)
Log from macOS arm64, with the setup output trimmed
✓ Vite+ setup complete.
vp v1.5.0
info: checking for updates...
info: found [email protected] (current: 1.5.0)
info: downloading [email protected] for darwin-arm64...
info: installing...
error: Setup error: Failed to install Node.js 24.22.2: Failed to download from https://mirrors.aliyun.com/nodejs-release/v24.22.2/SHASUMS256.txt: HTTP status client error (403 Forbidden) for url (https://mirrors.aliyun.com/nodejs-release/v24.22.2/SHASUMS256.txt)
info: checking for updates...
info: found [email protected] (current: 1.5.0)
info: downloading [email protected] for darwin-arm64...
info: installing...
✓ Dependencies installed.
✓ Updated vite-plus from 1.5.0 → 1.5.1
Run `vp migrate` in any Vite+ project using a version under 1.5.1 to upgrade that project's Vite+ version.
Release notes: https://github.com/voidzero-dev/vite-plus/releases/tag/v1.5.1
vp v1.5.1
naokihaba commented on Nov 10, 2026 @toggery
vp does not send a User-Agent header. The aliyun mirror returns 403 for requests without this header. Other mirrors in China, for example npmmirror, accept these requests.
As a permanent fix, we are considering making vp send a User-Agent header. Only new versions of vp will have this fix. During vp upgrade, your installed version downloads Node.js, so the upgrade to the fixed version will also fail with aliyun. You will need to change the mirror temporarily for that upgrade.
Can you change VP_NODE_DIST_MIRROR to a different mirror in your environment?
If you cannot change the mirror, please tell us the reason, for example a network policy. We will use your answer to choose the fix. naokihaba commented on Nov 10, 2026 Update: fengmk2 agreed with this approach ("We can add a User-Agent header to fix this."). I am working on the fix.
@fengmk2
I want to discuss the investigation result and the fix plan for #3422. vp does not send a User-Agent header in its HTTP requests. The Alibaba Cloud mirror at mirrors.aliyun.com returns 403 for requests without this header. When VP_NODE_DIST_MIRROR points to aliyun, vp upgrade cannot download Node.js and fails. A new installation with the install script fails with the same error.
I propose to set a User-Agent such as vp/<version> on all requests in the shared HTTP client. The change is in build_with in crates/vp_shared/src/http.rs. npm and pnpm send a User-Agent by default. I checked this with a local server that logs request headers. npm 11.20.0 sent npm/11.20.0 node/v26.13.0 darwin arm64 workspaces/false. pnpm 12.18.0 sent pnpm/12.18.0 npm/? node/? darwin arm64.
This fix has one limit. During vp upgrade, the installed binary downloads Node.js. The binaries that users have now do not have the fix, so these users cannot upgrade to the fixed version through aliyun. We will need to ask them to change the mirror only for the upgrade. I confirmed that vp upgrade from 1.5.0 to 1.5.1 succeeds with VP_NODE_DIST_MIRROR=https://npmmirror.com/mirrors/node.
I do not know the mirror situation in China well. I asked the reporter in the issue if they can change the mirror, and I am waiting for the answer.
Is it OK to fix this by setting the User-Agent on all requests?
The reproduction is at https://github.com/naokihaba/vite-plus-issue-3422. naokihaba commented on Nov 10, 2026 @toggery
We merged the fix in #3425. vp now sends a User-Agent header, so the aliyun mirror accepts its requests. The next release will include this fix.
Your installed vp does not have the fix, so the upgrade to the next release will also fail with aliyun. For this upgrade only, please change the mirror. For example, in PowerShell:
$env:VP_NODE_DIST_MIRROR="https://npmmirror.com/mirrors/node"
vp upgrade
After the upgrade, you can use the aliyun mirror again. Reacted by Togger JIANG Reacted by Togger JIANG added a commit that references this issue on Nov 10, 2026This issue will close once commit 511e006 is merged into the 'main' branch.511e006 toggery commented on Nov 13, 2026 @naokihaba
Thank you very much for your quick reponse and effective solutions.
Yes, I can change VP_NODE_DIST_MIRROR and upgrade successfully. naokihaba commented on Nov 13, 2026
@naokihaba Thank you very much for your quick reponse and effective solutions. Yes, I can change VP_NODE_DIST_MIRROR and upgrade successfully.
I'm so glad to hear that!
Thank you very much for letting me know.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|