question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cdktf get failing when using asdf version manager

See original GitHub issue

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave “+1” or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

cdktf & Language Versions

cdktf --version 0.9.0

golang 1.16 terraform 1.1.5 nodejs 14.18.3

Affected Resource(s)

N/A

Debug Output

cdktf get
⠧ downloading and generating modules and providers...
No version is set for command terraform
Consider adding one of the following versions in your config file at
Error: non-zero exit code 126
    at ChildProcess.<anonymous> (/Users/doneill/.asdf/installs/nodejs/14.18.3/.npm/lib/node_modules/cdktf-cli/bundle/bin/cmds/handlers.js:43:1685)
    at Object.onceWrapper (events.js:520:26)
    at ChildProcess.emit (events.js:400:28)
    at maybeClose (internal/child_process.js:1058:16)
    at Socket.<anonymous> (internal/child_process.js:443:11)
    at Socket.emit (events.js:400:28)
    at Pipe.<anonymous> (net.js:686:12) {
  stderr: 'No version is set for command terraform\n' +
    'Consider adding one of the following versions in your config file at \n' +
    'terraform 1.1.5\n'
}

Expected Behavior

cdktf get should succeed

Actual Behavior

cdktf get fails

Steps to Reproduce

See above

Important Factoids

Using asdf for managing go, terraform and node.

References

Following this example - https://github.com/hashicorp/terraform-cdk/blob/main/docs/getting-started/go.md

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
matschaffer-robloxcommented, Oct 25, 2022

Thanks for filing this. I ran into the same issue. As a workaround I added an .envrc like this so https://direnv.net/ can point cdktf to the asdf-provided binary.

export TERRAFORM_BINARY_NAME="$(asdf which terraform)"

I also opened https://github.com/asdf-community/asdf-hashicorp/issues/64 for consideration in the asdf plugin.

1reaction
damianoneillcommented, Feb 14, 2022

@ansgarm just noticed your docs comment (separate issue), there is an example here https://github.com/damianoneill/cdk if it helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

asdf: Home
Manage multiple runtime versions with a single CLI tool.
Read more >
gdk update failing due to asdf being installed by brew - GitLab
Please use the package manager that you used to install asdf to upgrade asdf. ERROR: Failed to update asdf. make: *** [asdf-update] Error...
Read more >
homebrew-core - Homebrew Formulae
a2ps 4.14 Any‑to‑PostScript filter aacgain 1.8 AAC‑supporting version of mp3gain aalib 1.4rc5 Portable ASCII art graphics library aamath 0.3 Renders mathematical expressions as ASCII art
Read more >
External contributions - Sourcegraph handbook
Find its link directly in the #buildkite-main channel. Or run sg ci status in your shell, with the main branch checked out. Search...
Read more >
hashicorp-terraform/Lobby - Gitter
Error: failed to render : <template_file>:11,88-89: Invalid character; ... And if inconsistencies just mean getting hit with extra plan steps that could be ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found