title: selenium-webdriver: The geckodriver executable could not be found on the current PATH
body: <p>I installed the selenium webdriver using the following command:</p>
  <pre><code>$ npm i selenium-webdriver
  </code></pre>
  <p>Then, I created the directory <code>D:\WebDriver\bin</code> (and added the files <code>geckodriver.exe</code> and <code>operadriver.exe</code> to that directory) and added it to the system's PATH variables.</p>
  <p>The PATH to the directory that contains both drivers was successfully added, as can be seen below:</p>
  <pre><code>$ printenv PATH
  /mnt/d/WebDriver/bin/
  $ ls &quot;/mnt/d/WebDriver/bin/&quot;
  geckodriver.exe  operadriver.exe
  </code></pre>
  <p>I am also able to run the geckodriver via cmd.exe (Same applies to operadriver):</p>
  <pre><code>C:\Users\user&gt;geckodriver
  1621873805268   geckodriver     INFO    Listening on 127.0.0.1:4444
  </code></pre>
  <p>When I try to run one example file (google_search) via:</p>
  <pre><code>/mnt/d/proj/node_modules/selenium-webdriver/example $ node google_search.js
  
  </code></pre>
  <p>I receive the following stacktrace:</p>
  <pre><code>Error: The geckodriver executable could not be found on the current PATH. Please download the latest version from https://github.com/mozilla/geckodriver/releases/ and ensure it can be found on your PATH.
  </code></pre>
  <p>The operadriver also cannot be found when setting up an example that uses the opera driver.</p>
  <p>Worth mentioning is that I use a Windows Subsystem for Linux (WSL) and ran the commands (node, printenv and npm) in the terminal of that subsystem. The path variable was set on the Windows system and the required drivers were only installed on the Windows system. I can access the installed files on my windows system via the WSL terminal, but selenium still cannot find the specific driver(s).</p>
  <p>When I run the above mentioned test file (google_search.js) from selenium-webdriver on the Windows system, it does find the web driver and works as expected. I still cannot figure out the reason why the driver is not being found in the WSL.</p>