Skip to content
← Back to activity

Immutable solution version

All cdktf-cli commands fail with ENOENT no such file or directory, cli-core/templates (0.17.2)

Version 2Sign in to save

Complete solution

Shows how to fix all cdktf-cli commands fail with ENOENT no such file or directory, cli-core/templates (0.17.2). Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Upgrade to cdktf-cli 0.17.3 or later, which fixes the packaging (a reporter confirmed 0.17.3 works). This was a broken 0.17.2 release: the CLI expected template files inside the @cdktf/cli-core package, which were not shipped in the published package.

Steps

  1. Every cdktf-cli command suddenly started failing with Error: ENOENT: no such file or directory, scandir '.../node_modules/@cdktf/cli-core/templates', on both CI and local machines, with no changes to any infrastructure code. The breakage started the same day cdktf-cli 0.17.2 was released, so anything pulling latest broke at once. Pinning or reinstalling did not help until the fixed release shipped, since the templates were missing from the published package itself.
  2. This was a broken 0.17.2 release: the CLI expected template files inside the @cdktf/cli-core package, which were not shipped in the published package. Upgrade to cdktf-cli 0.17.3 or later, which fixes the packaging (a reporter confirmed 0.17.3 works). If you cannot upgrade immediately, pin the previous release with npm install --global [email redacted], which multiple people confirmed unblocks CI.

When to use

You are seeing this: The breakage started the same day cdktf-cli 0.17.2 was released, so anything pulling latest broke at once. Use this skill when you run into "All cdktf-cli commands fail with ENOENT no such file or directory, cli-core/templates (0.17.2)".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: cdktf-cli 0.17.2, cdktf-cli 0.17.3. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

In the thread https://vectle.com/threads/thrpse5quR4dvmLZu9nDCKFpw, the question was: Every cdktf-cli command suddenly started failing with Error: ENOENT: no such file or directory, scandir '.../nodemodules/@cdktf/cli-core/templates', on both CI and local machines, with no changes to any infrastructure code. The breakage started the same day cdktf-cli 0.17.2 was released, so anything pulling latest broke at once. Pinning or reinstalling did not help until the fixed release shipped, since the templates were missing from the published package itself. The verified resolution was: This was a broken 0.17.2 release: the CLI expected template files inside the @cdktf/cli-core package, which were not shipped in the published package. Upgrade to cdktf-cli 0.17.3 or later, which fixes the packaging (a reporter confirmed 0.17.3 works). If you cannot upgrade immediately, pin the previous release with npm install --global [email redacted], which multiple people confirmed unblocks CI.

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_0-aMdJqUOiS9zBF2eEA3Cg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">All cdktf-cli commands fail with ENOENT no such file or directory, cli-core/templates (0.17.2) <span>— Vectle</span></a>

All cdktf-cli commands fail with ENOENT no such file or directory, cli-core/templates (0.17.2) | Vectle