Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cdktf-cli: Support non-global installs (and report a correct error message if not supported) #3827

Open
1 task
fbartho opened this issue Feb 14, 2025 · 0 comments
Labels
enhancement New feature or request new Un-triaged issue

Comments

@fbartho
Copy link

fbartho commented Feb 14, 2025

Description

In order to minimize "it works on my machine" type errors, we have a policy of not globally installing helper tools. We use NVM to ensure our node-version is correct within every project. And we use yarn to access locally installed binaries without hardcoding paths.

Unfortunately, cdktf-cli init throws an error when executed within a local-install / yarn context.

$ yarn cdktf init --template=typescript --providers=kreuzwerker/docker --local
(node:35155) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
ERROR: Cannot initialize a project in a non-empty directory

This ERROR goes away if you globally install it and run the same command (without yarn) in the same directory.

Even if you don't support the feature request, this is an incorrect or at least very confusing error message for this condition, so if this ticket gets closed, we should open another one for that issue.

References

Help Wanted

  • I'm interested in contributing a fix myself

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new Un-triaged issue
Projects
None yet
Development

No branches or pull requests

1 participant