Repository navigation
Labels
Description
Describe the bug
vp upgrade
info: checking for updates...
info: found [email protected] (current: 1.5.0)
info: downloading [email protected] for win32-x64-msvc...
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)
Reproduction
Steps to reproduce
No response
System Info
vp env current
VITE+ - The Unified Toolchain for the Web
Node.js:
Version 24.15.0
Source lts
Bin Path C:\Users\togger\.vite-plus\js_runtime\node\24.15.0\node.exe
Installed true
Mode managed
vp --version
VITE+ - The Unified Toolchain for the Web
vp v1.5.0
Local vite-plus:
vite-plus Not found
Tools:
vite Not found
rolldown Not found
vitest Not found
oxfmt Not found
oxlint Not found
oxlint-tsgolint Not found
tsdown Not foundUsed Package Manager
pnpm
Logs
Validations
- Read the Contributing Guidelines.
- Check that there isn't already an issue for the same bug.
- Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- The provided reproduction is a minimal reproducible example.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
None yet
Effort
None yet
Target date
None yet
Start date
None yet
Activity
naokihaba commentedon Nov 10, 2026
I investigated this issue and made a reproduction at https://github.com/naokihaba/vite-plus-issue-3422. The aliyun mirror returns
403for requests without aUser-Agentheader.vpsends 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.txtwith the timestamp 2026-10-29 02:35, UTC+8. nodejs.org sendsLast-Modified: Wed, 28 Oct 2026 18:35:19 GMTfor 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-Agentheader. This is the cause.curlwith its defaultUser-Agentgets200.curl -H 'User-Agent:'gets403on 5 out of 5 requests.vp_shared::shared_http_clientincrates/vp_shared/src/http.rsdoes not set aUser-Agent, and reqwest does not send one by default. I also ran a local mirror that logs request headers. It shows thatvpsendsGET /v24.22.2/SHASUMS256.txtwith noUser-Agent.vp upgradeinstalls the dependencies of the new release with the Node.js version invpNodeVersion. The platform package metadata has this field.curl -s https://registry.npmjs.org/@voidzero-dev%2Fvite-plus-cli-darwin-arm64/1.5.1 | jq .vpNodeVersionreturns"24.22.2". The upgrade does not use the Node.js thatvp envmanages, which is 24.15.0 in this report. If the runtime cache does not contain 24.22.2,vpdownloads it fromVP_NODE_DIST_MIRROR.With
VP_NODE_DIST_MIRROR=https://mirrors.aliyun.com/nodejs-release,vp upgradefrom 1.5.0 to 1.5.1 fails with the same403 Forbiddenerror as this report. A local mirror that rejects requests without aUser-Agentgives the same error. WithoutVP_NODE_DIST_MIRROR,vpuses nodejs.org, and the upgrade succeeds.naokihaba commentedon 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-Agentheader tov24.22.2/SHASUMS256.txton each mirror. Only aliyun returns403.User-Agenthttps://mirrors.aliyun.com/nodejs-release403https://npmmirror.com/mirrors/node200https://mirrors.tuna.tsinghua.edu.cn/nodejs-release200https://mirrors.ustc.edu.cn/node200https://mirrors.huaweicloud.com/nodejs200https://mirrors.cloud.tencent.com/nodejs-release200With
VP_NODE_DIST_MIRROR=https://npmmirror.com/mirrors/node,vp upgradefrom 1.5.0 to 1.5.1 succeeds with the same 1.5.0 binary.Script
Log from macOS arm64, with the setup output trimmed
naokihaba commentedon Nov 10, 2026
@toggery
vpdoes not send aUser-Agentheader. The aliyun mirror returns403for requests without this header. Other mirrors in China, for example npmmirror, accept these requests.As a permanent fix, we are considering making
vpsend aUser-Agentheader. Only new versions ofvpwill have this fix. Duringvp 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_MIRRORto 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 commentedon 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.
vpdoes not send aUser-Agentheader in its HTTP requests. The Alibaba Cloud mirror atmirrors.aliyun.comreturns403for requests without this header. WhenVP_NODE_DIST_MIRRORpoints to aliyun,vp upgradecannot download Node.js and fails. A new installation with the install script fails with the same error.I propose to set a
User-Agentsuch asvp/<version>on all requests in the shared HTTP client. The change is inbuild_withincrates/vp_shared/src/http.rs. npm and pnpm send aUser-Agentby default. I checked this with a local server that logs request headers. npm 11.20.0 sentnpm/11.20.0 node/v26.13.0 darwin arm64 workspaces/false. pnpm 12.18.0 sentpnpm/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 thatvp upgradefrom 1.5.0 to 1.5.1 succeeds withVP_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-Agenton all requests?The reproduction is at https://github.com/naokihaba/vite-plus-issue-3422.
naokihaba commentedon Nov 10, 2026
@toggery
We merged the fix in #3425.
vpnow sends aUser-Agentheader, so the aliyun mirror accepts its requests. The next release will include this fix.Your installed
vpdoes 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:After the upgrade, you can use the aliyun mirror again.
fix(http): send a User-Agent header on all requests (voidzero-dev#3425)
toggery commentedon Nov 13, 2026
@naokihaba
Thank you very much for your quick reponse and effective solutions.
Yes, I can change
VP_NODE_DIST_MIRRORand upgrade successfully.naokihaba commentedon Nov 13, 2026
I'm so glad to hear that!
Thank you very much for letting me know.