VectleSkillsnpm install fails with "ERESOLVE unable to resolve dependency tree" for @cdktf/provider packages

npm install fails with "ERESOLVE unable to resolve dependency tree" for @cdktf/provider packages

Export

Fixes the npm ERESOLVE peer-dependency conflict when installing CDKTF provider packages built against a different cdktf version (e.g. provider-docker 3.0.11 wanting cdktf ^0.13.0 while the project has 0.14.0-pre.5). Covers aligning versions, --legacy-peer-deps, and regenerating bindings with cdktf get. Use when npm install of a @cdktf/provider-* package fails on peer deps. Not for cdktf synth or deploy errors.

TL;DR

Align the provider package version with your cdktf version (check the provider's peer dependency range), or install with npm install --legacy-peer-deps as a short-term workaround. Long term, regenerate bindings with cdktf get so the provider matches your cdktf.

The error

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! Found: cdktf@0.14.0-pre.5
npm ERR! Could not resolve dependency:
npm ERR! peer cdktf@"^0.13.0" from @cdktf/provider-docker@3.0.11

Fix it

  1. Check which cdktf version your project uses (npm ls cdktf) and which range the provider wants (the error names it, e.g. ^0.13.0).
  2. Preferred: install a provider release whose peer range includes your cdktf version, e.g. npm install @cdktf/provider-docker@[matching].
  3. Alternative: generate the bindings yourself with cdktf get / cdktf provider add instead of installing a prebuilt provider package; generated bindings track your cdktf version.
  4. Short-term workaround only: npm install --legacy-peer-deps (accepts a possibly broken resolution; verify cdktf synth still works after).
  5. Re-run cdktf synth to confirm the installed provider actually works.

Expected result: npm install completes and synth runs against the provider.

When to use this

  • npm install @cdktf/provider-* fails with ERESOLVE peer dependency errors
  • You are on a cdktf pre-release or a new minor and the prebuilt provider lags behind

When NOT to use this

  • The install succeeds but synth fails (that is a code/schema problem)
  • You use Python/Go (use pip/Go modules; the same version-skew idea applies to cdktf-cdktf-provider-* pins)

Root cause

Prebuilt @cdktf/provider-* packages declare a peer dependency on a specific cdktf range. When your project moves to a newer (or pre-release) cdktf first, npm refuses to resolve the tree because no single cdktf satisfies both. The provider bindings are generated against a cdktf version, so a stale prebuilt package is genuinely built for the older API.

Edge cases

  • --force also bypasses the check but is harsher than --legacy-peer-deps; prefer the latter.
  • After upgrading cdktf, re-run cdktf get to regenerate bindings even if npm is happy.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=npm+install+fails+with+%22ERESOLVE+unable+to+resolve+dependency+tree%22+for+%40cdktf%2Fprovider+packages&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.