Gateway & Routing · recorded 2026-08-29 · applies to 1 tool(s) ✓ Verified

Problem: EBADENGINE: Node version doesn't meet the engines requirement —— Trove problem library

Verified 2026-08-29EBADENGINE means Node doesn't meet engines — nvm install 22, switch, and reinstall the global package.

Quick fix

# One-liner: install 22 with nvm, switch, then reinstall
nvm install 22 && nvm use 22 && npm install -g @musistudio/claude-code-router

What you will run into

npm install -g @musistudio/claude-code-router reports EBADENGINE, saying the engine node requirement isn't met.

Not a network issue and not a broken package - the package engines require Node 20 || >=22, and your system Node is too old (18/19/21 all fail).

Why this happens

claude-code-router declares an engines field (Node 20 || >=22); npm checks the current Node version at install time and refuses with EBADENGINE when it doesn't match.

Multi-Node environments (nvm / Windows / WSL mixed) are especially prone: you think you're on the new version, but the old one is actually active.

engines is the package author's runtime environment contract: npm reads the field at install time, compares it with the current Node version, and refuses with EBADENGINE when unsatisfied.

This is protective by design — it prevents installing a package that "installs but cannot run".

The multi-version trap sits one layer deeper: nvm use 22 only switches the version nvm manages, while the shell actually executes the first node that appears in PATH.

A common failure: nvm's node 22 is installed, but a system node 18 sits earlier in PATH, so node --version still says 18 after nvm use. So the check order is fixed: which node first to see what is actually active, then talk about upgrading.

Step by step

1. Confirm the active version — Required

node --version && which node

Check what which node points to - in mixed environments you often nvm use 22 but the PATH still has the old one.

2. Install the new version and switch — Required

nvm install 22 && nvm use 22

(Or nvm install 20 - either satisfies 20 || >=22.)

3. Retry the install — Required

npm install -g @musistudio/claude-code-router

Success = no more EBADENGINE.

How to confirm it works

ccr --version

Version prints = success (measured: install succeeded under Node v22.22.1, exit=0).

Other environments

EnvironmentNotes
Node 18/19/21Don't satisfy engines; must upgrade to 20 or 22
nvm multi-versionAfter nvm use 22, confirm with which node
Windows/WSL mixedEach side has its own Node; don't expect Windows node to serve WSL
CIPin a Node 22 image

Symptom

npm install -g @musistudio/claude-code-router reports EBADENGINE, saying the engine node requirement isn't met.

Cause

The package engines require Node 20 || >=22; the system Node is too old (18/19/21 all fail).

Solution

  1. Install a new version with nvm and switch: nvm install 22 && nvm use 22 (or nvm install 20).
  2. In multi-Node environments (nvm/Windows/WSL mixed) first confirm the active version: node --version, which node.
  3. Retry the install once the version satisfies the requirement.
Verification Evidence
  • Web case: CSDN (2026-03, EBADENGINE scenario).
  • Measured in this marketplace: Node v22.22.1 in this environment, install succeeded (first line: node: v22.22.1).

Applicable tools (1)

This problem is linked from the tool pages below — reachable from either side.

claude-code-router

Source & evidence

Recorded Verified ✓ VerifiedApplies to 1 tool(s)
Entries contain locally measured or reviewable-source solutions; unmeasured items are explicitly labeled.

← Gateway & Routing domain | Problem Catalog Experience | Facing another issue? Go to the Helpdesk