# How can I resolve "could not use PowerShell to find Visual Studio 2017 or newer" while installing kibana

**URL:** <https://discuss.elastic.co/t/how-can-i-resolve-could-not-use-powershell-to-find-visual-studio-2017-or-newer-while-installing-kibana/309932>\
**Category:** Kibana\
**Created:** [July 18, 2022, 5:35pm UTC](https://discuss.elastic.co/t/how-can-i-resolve-could-not-use-powershell-to-find-visual-studio-2017-or-newer-while-installing-kibana/309932 "2022-07-18T17:35:52Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![najmiehsa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/najmiehsa/32/105130_2.png) [@najmiehsa](https://discuss.elastic.co/u/najmiehsa)\
**Post date:** [July 18, 2022, 5:35pm UTC](https://discuss.elastic.co/t/how-can-i-resolve-could-not-use-powershell-to-find-visual-studio-2017-or-newer-while-installing-kibana/309932/1 "2022-07-18T17:35:52Z")

</div>

Hi,

I have visual studio 2022 community and visual studio 2022 build tools installed and config them with npm. But when I try to install **kibana** I encounter this error:

> could not use PowerShell to find Visual Studio 2017 or newer

This indicates that the installation process is unable to find the path to the PowerShell and visual studio 2015 C++.

I have tried to run all the commands with the admin level and still the same node-gyp errors occur.

How can I get past these errors?  
I appreciate hints.

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [July 23, 2022, 5:44pm UTC](https://discuss.elastic.co/t/how-can-i-resolve-could-not-use-powershell-to-find-visual-studio-2017-or-newer-while-installing-kibana/309932/2 "2022-07-23T17:44:46Z")

</div>

are you trying to build kibana or just run kibana?

---

<div class="post-metadata">

**Author:** ![najmiehsa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/najmiehsa/32/105130_2.png) [@najmiehsa](https://discuss.elastic.co/u/najmiehsa)\
**Post date:** [July 23, 2022, 7:01pm UTC](https://discuss.elastic.co/t/how-can-i-resolve-could-not-use-powershell-to-find-visual-studio-2017-or-newer-while-installing-kibana/309932/3 "2022-07-23T19:01:05Z")

</div>

Thank you for the reply.

My initial aim is to build but I think to be able to do that I need to run kibana and Elasticsearch as prequisites.

This is the path I've followed so far:

I cloned kibana and followed [this guide](https://www.elastic.co/guide/en/kibana/current/development-getting-started.html) for getting started. I had many errors and I resolved most of them except for this one.

> could not use PowerShell to find Visual Studio 2017 or newer

I switched to docker and pulled both kibana and elasticSearch.

Then I considered that I need to install both of them separately as well. Now I installed kibana but not elasticSearch.

I can generate the enrollment token on docker via the Elasticsearch terminal but I have not been able to get the validation key. I'll re-follow [this guide](https://www.elastic.co/guide/en/elasticsearch/reference/current/configuring-stack-security.html) to find more insights.

I might have missed some stages here. I appreciate any inputs I receive.

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [August 12, 2022, 7:56pm UTC](https://discuss.elastic.co/t/how-can-i-resolve-could-not-use-powershell-to-find-visual-studio-2017-or-newer-while-installing-kibana/309932/4 "2022-08-12T19:56:44Z")

</div>

I think the easiest way to get started is to run them from the tar.gz(Linux) or zip(Windows) packages. They come with pretty much anything you need to run them and they are like a portable install, so they won't leave any traces if you decide to move with other packages.

---

<div class="post-metadata">

**Author:** ![najmiehsa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/najmiehsa/32/105130_2.png) [@najmiehsa](https://discuss.elastic.co/u/najmiehsa)\
**Post date:** [August 13, 2022, 4:26am UTC](https://discuss.elastic.co/t/how-can-i-resolve-could-not-use-powershell-to-find-visual-studio-2017-or-newer-while-installing-kibana/309932/5 "2022-08-13T04:26:51Z")

</div>

Thank you for the reply.

I could find a hint for the "Could not run Powershell" problem. [Setting the execution policy to bypass](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy?view=powershell-7.2) can solve this.

But it seems that my system has some sort of cache that prevents the execution. One of these could be the _bazelisk cache_

It also seems git keeps some kind of history in terms of previous errors because Although I run **kbn yarn reset** or **clean** or **yarn cache clean** I still face previous issues.

And after a couple of failed installation processes, it can not find the path for the **bazeliskversion** file in the root folder.

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [August 14, 2022, 1:48am UTC](https://discuss.elastic.co/t/how-can-i-resolve-could-not-use-powershell-to-find-visual-studio-2017-or-newer-while-installing-kibana/309932/6 "2022-08-14T01:48:34Z")

</div>

Running from source is not supported on Windows due to how bazelisk works. The only way to do it is to use WSL to run it.

---

<div class="post-metadata">

**Author:** ![najmiehsa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/najmiehsa/32/105130_2.png) [@najmiehsa](https://discuss.elastic.co/u/najmiehsa)\
**Post date:** [August 14, 2022, 6:31am UTC](https://discuss.elastic.co/t/how-can-i-resolve-could-not-use-powershell-to-find-visual-studio-2017-or-newer-while-installing-kibana/309932/7 "2022-08-14T06:31:43Z")

</div>

Will an attempt to install **kibana** on ubuntu make **bazelisk** work? I can switch to ubuntu.

I've tried docker, and the configuration for Elasticsearch as a prerequisite of **kibana** from the last section of [this source](https://docker-curriculum.com/) initially worked for me.

```auto
$ docker run -d --name es -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:8.3.3

```

I still need to configure  
docker compose, volume, and docker files.

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [August 15, 2022, 2:51pm UTC](https://discuss.elastic.co/t/how-can-i-resolve-could-not-use-powershell-to-find-visual-studio-2017-or-newer-while-installing-kibana/309932/8 "2022-08-15T14:51:17Z")

</div>

yes it will work on ubuntu or macos. or ubuntu in windows with WSL.  
As for docker, you don't need to configure much in the docker-compose, just add both of them to the same network. map the ports and add some a volume to ES for data.  
There are various docker\_compose.yml samples online, I think most of them will work with minimal change.

---

<div class="post-metadata">

**Author:** ![najmiehsa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/najmiehsa/32/105130_2.png) [@najmiehsa](https://discuss.elastic.co/u/najmiehsa)\
**Post date:** [August 15, 2022, 4:12pm UTC](https://discuss.elastic.co/t/how-can-i-resolve-could-not-use-powershell-to-find-visual-studio-2017-or-newer-while-installing-kibana/309932/9 "2022-08-15T16:12:36Z")

</div>

Thank you for the follow-up replies. Highly appreciate it.

In regard to Docker,

The missing step for me is when I tried to map them to one another, I received the error "Could not fetch". I notice that when I pulled elastic for the first time and tried to generate an enrollment token, only one it time gave me a unique token.

When I inserted the token into the kibana configuration page and then inserted the validation key, I received the error "couldn't fetch" .

I think it is because it wasn't a `discovery.type=single-node` or it can be because of the net.

When I tried to generate another enrollment token on docker it gave me the same exact token as before and I was not able to generate a new token.

The second problem I have is how to locate the **kibana** docker files.  
As for other projects, I cloned the repository and installed them with a similar `yarn` command.

When I opened the project on VScode It automatically made configurations with the VScode dev container and redirected me to a URL.

I tried to do the same with Remote - Containers extension for kibana but I couldn't do the same. It didn't read and show all the docker files and I could not make any changes to the files.

Also related to the docker files, previously the yarn kbn bootstrap was not done and this could be a reason.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 12, 2022, 4:12pm UTC](https://discuss.elastic.co/t/how-can-i-resolve-could-not-use-powershell-to-find-visual-studio-2017-or-newer-while-installing-kibana/309932/10 "2022-09-12T16:12:40Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
