GTFTT
GTFTT

Reputation: 331

WebStorm and WSL: Failed to prepare environment: Trying to get WSL path from a different WSL distribution

I cannot configure WebStorm to work with my projects in WSL (this happened after I reinstalled my Windows OS and WSL). I think that the problem is related to WSL configuration, but I cannot find which exactly.

enter image description here

The same problem with ESLint in my projects:

enter image description here

enter image description here

C:\Users\FTowe>wsl --status
Default Distribution: Ubuntu
Default Version: 2

Windows Subsystem for Linux was last updated on 3/6/2022
The Windows Subsystem for Linux kernel can be manually updated with 'wsl --update', but automatic updates cannot occur due to your system settings.
To receive automatic kernel updates, please enable the Windows Update setting: 'Receive updates for other Microsoft products when you update Windows'.
For more information please visit https://aka.ms/wsl2kernel.

Kernel version: 5.10.16

C:\Users\FTowe>
gt@DESKTOP-8828LLP:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.4 LTS
Release:        20.04
Codename:       focal
gt@DESKTOP-8828LLP:~$

What is wrong with my WSL distribution and how to fix this problem?

Upvotes: 4

Views: 1846

Answers (2)

Hadnazzar
Hadnazzar

Reputation: 1616

I was having the same issue.

The steps i made for fix

Check nvm is installed with node version and available on the terminal.

Check in your bash profile nvm scripts added as below

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

Check is your interpreter set correctly with WSL.

After that re install the webstorm one more time.

Good luck

Upvotes: 0

GTFTT
GTFTT

Reputation: 331

So, thanks to @lena I found this new Ubuntu /home/... version in my node interpreter version configuration(the previous selection was Ubuntu-20.04 /home/... and then the same path to node).

did you try removing the existing Node wsl interpreter configuration in Node.js Interpreters

enter image description here

After I checked another option(Ubuntu /home/...), applied, and clicked OK everything started working again. But the previous option disappeared when I opened settings again. I checked it a few times in different projects and confused about that.

enter image description here

As I can remember there was no another option Ubuntu /home/... before. So it kind of solved itself? Thanks, everyone!

Upvotes: 5

Related Questions