What this thread does
The problem
Identify the missing API, rejected algorithm or native package before changing Node or lockfiles.
Version boundaries, checked 2026-11-15
| Official source | Boundary | Consequence |
|---|---|---|
| Node release note | Node 17.0.0 introduced OpenSSL 3.0 | Legacy algorithms can fail. |
| Node crypto API | crypto.hash added in 20.12.0 and 21.7.0 | API presence alone is insufficient for Vite. |
| Vite 7 guide | Node 20.19+ or 22.12+ | Check the minor version too. |
| Vite 8 announcement | Stable Vite 8 on 2026-03-12; Rolldown bundler | Rollup/Rolldown bindings differ. |
| Node status | As of November 2026, Node 26, 24 and 22 LTS; 20 EOL | Prefer supported LTS meeting tool engines. |
| webpack docs | xxhash64 supported since 5.54.0 | Alternative for output hashing. |
Compatibility boundaries only.
Which repair to choose
| Message family | Inspect | Repair |
|---|---|---|
| digital envelope routines unsupported | Hashing caller in stack | Update owning tool/algorithm |
| crypto.hash is not a function | Executing Node binary | Select supported runtime |
| Missing native package | Target and optional dependencies | Reinstall; repair lockfile if incomplete |
Diagnose in the failing environment; keep the project's manager. Examples use npm.
node -p "JSON.stringify({node:process.version,exe:process.execPath,openssl:process.versions.openssl,platform:process.platform,arch:process.arch})"
node -p "typeof require('node:crypto').hash"
npm ls vite webpack rollup rolldown
npm config get omit
error:0308010C and unsupported hashing
The exact message is Error: error:0308010C:digital envelope routines::unsupported, verified in the community report, checked 2026-10-20.
OpenSSL can reject legacy webpack hashing or other algorithms/key sizes; inspect the stack. Node's explanation, checked 2026-10-20, describes the restrictions and a temporary legacy provider.
Update the owning framework/build dependency within its supported range, then run npm run build. If webpack output hashing is the caller and your version supports it, set output.hashFunction to xxhash64 and rebuild. Loaders/plugins can have separate hash calls. Official webpack reference, checked 2026-10-20.
Temporary POSIX-shell diagnostic:
NODE_OPTIONS=--openssl-legacy-provider npm run build
Do not persist this globally or downgrade to unsupported Node as the durable fix. It neither adds crypto.hash nor installs bindings.
crypto.hash is not a function
The exact message is TypeError: crypto.hash is not a function. byunginhb's issue reproduces it; maintainer bluwy gives Vite's Node range. Checked 2026-10-20.
The executing Node lacks the API. IDE/terminal/CI can select different binaries. Select supported LTS meeting Vite/templates, update pins and CI images, reopen the shell, then run:
node --version
node -p "typeof require('node:crypto').hash"
npm ci --include=optional
npm run dev
npm run build
function alone is insufficient. Read Node's API history and Vite's engine requirement, checked 2026-10-20.
Do not patch Vite, polyfill crypto, enable the legacy provider or delete healthy lockfiles.
Missing Rollup Linux native package
The verified error prefix is Error: Cannot find module @rollup/rollup-linux-x64-gnu. 0xBeycan's discussion shows it with an optional-dependency explanation, checked 2026-10-20.
The selected native package is absent/unresolvable. Check omission flags, incomplete lockfiles and copied host node_modules. Rollup's loader selects OS/architecture and glibc versus musl; npm's bug report documents missing platform optional dependencies. Checked 2026-10-20.
On target run npm ci --include=optional, then node -e "require('rollup')" and npm run build. npm ci cleans installation but cannot repair missing lockfile entries. Use regeneration below only if necessary. Official npm ci docs, checked 2026-10-20.
Do not force GNU bindings into musl/Alpine, install arbitrary binding versions, share node_modules across platforms, or delete lockfiles every CI run.
Missing Rolldown Windows native binding
The exact message is Error: Cannot find module '@rolldown/binding-win32-x64-msvc'. See RobTheTeacher's report, checked 2026-10-20.
In the Windows project run npm ci --include=optional, then node -e "import('rolldown').then(() => console.log('loaded'))" and npm run build. Official Rolldown troubleshooting, checked 2026-10-20, explains missing optional packages and symlinked configs resolving another project's install. Inspect the nested cause first.
If the binary exists but cannot load, inspect its loader error and Windows protection history. One reply reports quarantine; it is not proof of your cause. Do not disable antivirus, add broad exclusions, substitute Linux bindings or blindly approve scripts. Rolldown warns its preserve-symlinks workaround is incompatible with pnpm.
For an incomplete npm lockfile, Rolldown documents removing it and node_modules before reinstalling. Preserve both in a disposable checkout without existing backup names:
node -e "const f=require('node:fs'); if(f.existsSync('node_modules')) f.renameSync('node_modules','node_modules.before-repair'); f.renameSync('package-lock.json','package-lock.before-repair.json')"
npm install --include=optional
git diff -- package-lock.json
npm ci --include=optional
npm run build
Review this dependency re-resolution and test all targets. Do not replace pnpm/yarn lockfiles with this npm recipe.
What the community says
- Vite #20287 includes DanielMwamba's reported upgrade/reinstall success; bluwy's maintainer answer specifies supported Node. Checked 2026-11-15.
- Vite #15532 includes DavidAtInleague's report that keeping optional dependencies fixed CI; others warn against repeated lockfile deletion. Several causes, not a universal fix; checked 2026-10-20.
- Vite #21846 offers conflicting optional-dependency and antivirus explanations. Its small discussion supports investigating both; checked 2026-10-20.
A prompt to give your agent
Read the linked official source and maintainer answer; do not guess. Record the exact message, Node path/version, target, dependency chain and nested cause. Choose one repair, preserve manager/lockfile, explain re-resolution, rerun the failing command and report remaining failures. Never disable endpoint protection.
Limits
No installs, builds, migrations, containers or bindings were tested. All four supplied strings were verified; additional suffixes/variants are unverified. No latest patch/affected interval is claimed. Thin Windows evidence cannot establish quarantine as the general cause. Community results are attributed, not reproduced. Browser externalization, stale chunks and ESM require errors are separate jobs.
Started from a post by @byunginhb, packaged by the editor. Original post