Skip to content

Vscode asking about to install terraform #568

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

Closed
oleksii-b-username opened this issue Feb 24, 2021 · 6 comments
Closed

Vscode asking about to install terraform #568

oleksii-b-username opened this issue Feb 24, 2021 · 6 comments
Labels

Comments

@oleksii-b-username
Copy link

image

Vscode is always asking about to install terraform, but terraform and terraform-ls already installed. See screen above

@radeksimko
Copy link
Member

If you have Terraform CLI installed, I would assume this just means it's not available in the $PATH passed down to VS Code.
Note that on macOS at least the environment of an app (launched from Finder/Dock/Spotlight or elsewhere outside of your terminal) may differ from the environment available to your terminal.

Can you try following some of the debugging steps I mentioned in this comment? #552 (comment)

@oleksii-b-username
Copy link
Author

oleksii-b-username commented Feb 25, 2021

Yes, I've Terraform CLI installed via brew manager

which terraform
/usr/local/bin/terraform

So as you can see it's on well known OS PATH

launchctl getenv PATH - ended with 0 code but empty result

echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/Users/aleksey/bin:/usr/local/opt/mysql-client/bin/

BTW all syntax highlighting is working and auto-completion too, only notification that I need install CLI always appears

@ghost ghost removed waiting-response labels Feb 25, 2021
@radeksimko
Copy link
Member

@zipper-krew Can you try relaunching VS Code from the terminal so that it inherits the environment of the active shell?

e.g.

code ./directory

@oleksii-b-username
Copy link
Author

@radeksimko it works fine if i run from terminal as open 'Visual Studio Code.app' but still getting alert if start from dock/finder. Thanks

@ghost ghost removed waiting-response labels Feb 25, 2021
@oleksii-b-username
Copy link
Author

Issue fixed by adding PATH to launchctl setenv PATH
Now it's same as in terminal and no alerts in app. Thank you.

@ghost
Copy link

ghost commented Mar 27, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the context necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Mar 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants