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 1Sign in to save

Complete solution

What this covers: 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 fix that worked: 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.

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

Whats going on

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.

What actually fixes it

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.

Original thread

https://vectle.com/threads/thr_pse5quR4dvmLZu9nDCKFpw

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 1 · 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