Repository navigation
Closed
Labels
- P2: has workaroundAffects specific usage and has a straightforward workaround (priority)Affects specific usage and has a straightforward workaround (priority)pending triagetriage: fix verified
Description
Describe the bug
node, npm, pnpm, and bun all throw
vp: Failed to install Node 27.0.0-alpha.0.0.0: Hash not found for node-v27.0.0-alpha.0.0.0-darwin-x64.tar.gz in SHASUMS256.txt
Reproduction
N/A
Steps to reproduce
No response
System Info
global install
vp --version
vp v1.4.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 found
Environment:
Package manager Not found
Node.js v27.0.0-alpha.0.0.0vp env current
Node.js:
Version 27.0.0-alpha.0.0.0
Source default
Bin Path /Users/user/.local/share/vite-plus/js_runtime/node/27.0.0-alpha.0.0.0/bin/node
Installed false
Mode managed
local install
vp --version
vp v1.4.0
Local vite-plus:
vite-plus v1.0.0
Tools:
vite v8.3.1
rolldown v1.2.11
vitest v5.0.1
oxfmt v0.70.0
oxlint v1.85.0
oxlint-tsgolint v7.0.2003
tsdown v0.23.0
Environment:
Package manager pnpm v12.5.1
Node.js v27.0.0-alpha.0.0.0
vp env current
Node.js:
Version 27.0.0-alpha.0.0.0
Source default
Bin Path /Users/user/.local/share/vite-plus/js_runtime/node/27.0.0-alpha.0.0.0/bin/node
Installed false
Mode managed
Package Manager:
Name pnpm
Version 12.5.1
Source devEngines.packageManager
Bin Paths
pnpm /Users/user/.local/share/vite-plus/package_manager/pnpm/12.5.1/pnpm/bin/pnpm
pnpx /Users/user/.local/share/vite-plus/package_manager/pnpm/12.5.1/pnpm/bin/pnpx
Installed true
Mode managed
Used 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
- P2: has workaroundAffects specific usage and has a straightforward workaround (priority)Affects specific usage and has a straightforward workaround (priority)pending triagetriage: fix verified
Type
Fields
Priority
None yet
Effort
None yet
Target date
None yet
Start date
None yet
Activity
voidzero-bot commentedon Oct 30, 2026
crates/vp_js_runtime/src/runtime.rs::test_download_runtime_missing_platform_archivenode/npm/pnpm/bunshims for darwin-x64 users who have Nodev27.0.0-alpha.0.0.0as their default, but the user can work around it by switching to a different default Node version (e.g.vp env default lts).The root cause is in
crates/vp_js_runtime/src/runtime.rs:download_runtime_with_providerconstructs the platform archive name for the requested Node.js version, downloadsSHASUMS256.txt, and asksNodeProvider::parse_shasumsfor the hash. When the release omits a tarball for the host platform (asv27.0.0-alpha.0.0.0does for darwin-x64),parse_shasumsreturnsError::HashNotFound, which surfaces as the cryptic "Hash not found" message.I found a potential fix for this issue. The patch adds a new
MissingPlatformArchiveerror variant incrates/vp_js_runtime/src/error.rsand maps theHashNotFoundcase to it indownload_runtime_with_provider, producing a message likenode v27.0.0-alpha.0.0.0 does not provide a darwin-x64 archive (...); this version may not be available for your platform. It also adds a regression test and updates the existing lock-release test. Thevp_js_runtimetest suite passes, but please review before merging.Full Triage Report
Triage Report: Issue #3290 — Executables throwing
Issue Summary
Reporter: james-tindal
Title: Executables throwing
System: macOS (darwin-x64),
vp v1.4.0, managed Node.jsv27.0.0-alpha.0.0.0fromdefaultconfig.The reporter states that running
node,npm,pnpm, orbunthrough Vite+ shims fails with:Expected behavior: Vite+ should either install the requested runtime or produce a clear error explaining that the platform tarball is unavailable. Actual behavior: the commands crash with a low-level "Hash not found" message.
Environment Used for Reproduction
/home/runner/work/vite-plus/vite-plusvp v1.4.0(local build from checkout)v24.22.1v12.11.2/tmp/vite-plus-triage/gh-3290/vp-homeReproduction Steps
Installed the local CLI into an isolated
VP_HOME:Set the default Node.js version to the same alpha version reported:
Confirmed
vp env currentresolves to the alpha version withSource default:The Linux x64 tarball for
v27.0.0-alpha.0.0.0exists onnodejs.org, so the bug does not reproduce on the bare Linux runner. To reproduce the same SHASUMS "Hash not found" failure path, a local mirror was started that serves a valid index containingv27.0.0-alpha.0.0.0but aSHASUMS256.txtthat omits the current platform tarball.With the mirror configured, all four reported executables fail identically:
export VP_NODE_DIST_MIRROR=http://localhost:8765 node -v npm -v pnpm -v bun -vOutput for each:
Verification of the Underlying Cause
nodejs.org/dist/v27.0.0-alpha.0.0.0/SHASUMS256.txtcontainsnode-v27.0.0-alpha.0.0.0-darwin-arm64.tar.gzbut does not containnode-v27.0.0-alpha.0.0.0-darwin-x64.tar.gz.HashNotFounderror fromcrates/vp_js_runtime/src/error.rs.Control Case
Removing the custom mirror and deleting the cached alpha runtime causes VP to download
node-v27.0.0-alpha.0.0.0-linux-x64.tar.gzfromnodejs.orgsuccessfully:This confirms the failure is tied to the missing platform archive in the SHASUMS file, not to the alpha version string itself.
Result
Reproduced. The reported behavior occurs on the current checkout when the Node.js distribution's SHASUMS file does not include a tarball for the current platform. The reporter's darwin-x64 host hits this condition for
v27.0.0-alpha.0.0.0because Node.js shipped that alpha without adarwin-x64archive. Vite+ should provide a clearer message (e.g., "Platform tarball not available for Node X on platform Y") instead of the current "Hash not found" error.Diagnosis
Affected Code Path
Version resolution (exact version bypass)
crates/vp_global_cli/src/commands/env/config.rs:539-556—resolve_version_stringsees27.0.0-alpha.0.0.0as an exact semver version and returns it verbatim. It never checks whether Node.js actually publishes a tarball for the current platform.Shim dispatch
crates/vp_global_cli/src/shim/dispatch.rs:826-844—resolve_with_cachereturns the alpha version from thedefaultconfig, thenensure_installedtries to download it. Errors are surfaced asvp: Failed to install Node {version}: {error}.Runtime download / hash lookup
crates/vp_js_runtime/src/runtime.rs:184-208(download_runtime_with_provider) constructs the platform archive name viaprovider.get_download_info(version, platform), fetchesSHASUMS256.txt, and callsprovider.parse_shasums(...).SHASUMS parser
crates/vp_js_runtime/src/providers/node.rs:688-700—NodeProvider::parse_shasumsreturnsError::HashNotFound { filename: ... }as soon as the expected platform filename is absent from the SHASUMS file.Root Cause
NodeProviderunconditionally builds the URL/filename for the current platform (node-v{version}-{platform}.{ext}) and then asks the SHASUMS file for its hash. If the Node.js release lists other platform tarballs but omits the one for the host platform, the first indication of the problem is the crypticHashNotFounderror. Forv27.0.0-alpha.0.0.0, the release includesdarwin-arm64but notdarwin-x64, so every darwin-x64 user with this default version sees the reported failure on every shim invocation.The message is especially confusing because:
index.jsoncontains it).Suggested Fix
Add an explicit "missing platform archive" error path in
download_runtime_with_provider. Afterparse_shasumsreturnsError::HashNotFoundfor the expected archive filename, map it to a newErrorvariant (or reuse/extendUnsupportedPlatform) that mentions the version, the platform string, and the missing filename:Implementation options:
Minimal change in
crates/vp_js_runtime/src/runtime.rsWrap the
parse_shasumscall insidedownload_runtime_with_provider. OnError::HashNotFound, return a newError::MissingPlatformArchive { version, platform, filename }or an improvedUnsupportedPlatformthat includes the version. This requires only the platform string already available at that call site.Add a new error variant in
crates/vp_js_runtime/src/error.rsExample:
This gives callers (shim dispatch,
vp env install, etc.) a clear, actionable message without network overhead.(Optional) Pre-check
index.json#filesThe Node.js version index includes a
filesarray per release.NodeProvidercould check that array before constructing download info. This is a nice early-exit but is less robust than option 1 because custom mirrors may not populatefilesthe same way, whereas the SHASUMS file is authoritative for what can actually be downloaded.Edge Cases
SHASUMS256.txtwithout all platform entries. The SHASUMS-based check covers this automatically.osx-x64-pkgvs.darwin-x64). The fix stays correct as long as it relies on the actual SHASUMS content.ensure_installedonly enters the download path when the binary is not already cached, so the new error only affects fresh installs.Regression Evidence
No existing test asserts the missing-platform-tarball case.
crates/vp_js_runtime/src/providers/node.rshastest_parse_shasumsfor successful lookups, andcrates/vp_js_runtime/src/runtime.rsuseswith_mock_mirrorfor happy-path downloads, but neither exercises a SHASUMS that omits the host platform. A regression test should serve a mock index containing the version and a SHASUMS without the expected archive, then assert the improved error message.Confidence
High. The failure was reproduced on the current checkout using a local mirror that serves a valid index but a SHASUMS missing the host-platform tarball; all four reported tools (
node,npm,pnpm,bun) emit the exact sameHash not foundchain, and code inspection shows the only place the message originates isNodeProvider::parse_shasums.Verification
Claim
When the Node.js release for the resolved version does not include a tarball for the current platform, Vite+ shims fail with:
The reporter expects a clear indication that the platform build is unavailable. Vite+ currently surfaces a low-level hash lookup failure instead.
Research
docs/guide/env.mddescribes managed mode and version resolution but does not document any intentional behavior around missing platform tarballs or "Hash not found" errors.gh issue view 771invoidzero-dev/vite-plusis titledFailed to download Node.js 20: Hash not found for node-v20-linux-x64.tar.gz in SHASUMS256.txtand was labeled as a Bug before being closed. This establishes that the project treats this error surface as a bug, not expected behavior.crates/vp_js_runtime/src/error.rsdefines anUnsupportedPlatformerror variant, indicating the codebase already reserves a distinct error path for platform-related failures. That variant is currently unused for the missing-tarball case.crates/vp_js_runtime/src/providers/node.rs,test_parse_shasums).Verdict
Bug.
Reasoning
SHASUMS256.txt) but semantically misleading: it suggests a corrupted or incomplete hash file rather than a missing platform build.UnsupportedPlatformerror path, implying that platform availability problems should be reported separately.Confidence
High. Direct evidence comes from the prior bug classification (#771), the unused platform-specific error variant, and the absence of any documentation or test asserting that "Hash not found" is the intended UX for a missing platform archive.
Fix
Decision
Fixed. The bug was reproduced with high-confidence diagnosis and the root cause was clear and local to Vite+. No product decision or upstream change is needed.
Implementation
Changed files
crates/vp_js_runtime/src/error.rsMissingPlatformArchive { runtime, version, platform, filename }with a user-facing message explaining that the runtime version exists but does not provide an archive for the current platform.crates/vp_js_runtime/src/runtime.rsdownload_runtime_with_provider, whenprovider.parse_shasumsreturnsError::HashNotFoundfor the expected archive filename, map it toError::MissingPlatformArchiveusing the runtime name, requested version, current platform string, and archive filename.test_failed_download_releases_installation_locktest to expectMissingPlatformArchive(an empty SHASUMS now surfaces the missing-archive error).test_download_runtime_missing_platform_archivethat serves a Node.js index containingv27.0.0-alpha.0.0.0but aSHASUMS256.txtthat omits the host platform tarball, asserting the new error variant is returned.Rationale
The previous behavior correctly detected that the expected filename was absent from the SHASUMS file, but it surfaced a generic
HashNotFounderror. That message is misleading because the problem is not a corrupted hash file; it is that the Node.js release does not ship a tarball for the user's platform. Vite+ already had anUnsupportedPlatformerror variant, indicating the codebase distinguishes platform-related failures. A dedicatedMissingPlatformArchivevariant produces a clear, actionable message without adding extra network requests.Validation
Regression test
cargo test -p vp_js_runtime test_download_runtime_missing_platform_archiveResult:
test runtime::tests::test_download_runtime_missing_platform_archive ... okCrate test suite
cargo test -p vp_js_runtimeResult:
test result: ok. 136 passed; 0 failed; 0 ignoredBuild/check
Both passed.
Original reproduction (after fix)
Using the same isolated
VP_HOMEwith default Node.js27.0.0-alpha.0.0.0and a local mirror whose SHASUMS omits the host platform tarball:Before fix:
After fix:
All four reported tools (
node,npm,pnpm,bun) now surface the improved message.Control case
Removing the mirror and clearing the cache restores normal behavior; VP downloads
node-v27.0.0-alpha.0.0.0-linux-x64.tar.gzfromnodejs.organd the tools execute successfully:Skipped checks
cargo fmt --all --check: skipped becauserustfmtis not installed for the active nightly toolchain (nightly-2026-08-02).cargo clippy -p vp_js_runtime: skipped becauseclippyis not installed for the active nightly toolchain.cargo checkand focused test suite pass.Alternatives considered
index.json#filesbefore downloading: would add an early exit but is less robust for custom mirrors and requires fetching/understanding per-release file lists.UnsupportedPlatformvariant: that variant implies the platform is unsupported for the runtime in general, whereas the issue is version-specific (the current platform is supported, but this particular release omits its tarball).git diff
See the full diff in the checkout.
This report was made by an LLM. The analysis may be wrong, and the potential fix might not work, but is intended as a starting point for exploring the issue.
I've opened a pull request with this fix: #3291
naokihaba commentedon Nov 8, 2026
@james-tindal
Thanks for reporting this! In v1.4.0, the Node.js
latestalias was resolving to the27.0.0-alpha.0.0.0pre-release, which caused the shims to fail because it lacks adarwin-x64archive.We've fixed this in #3335 so that
latestpoints to the latest stable release instead. The fix is included in v1.5.0, so could you upgrade and give it another try?james-tindal commentedon Nov 8, 2026
Yeah that's working well now. Thanks!