WSL
WSL (WSL 2) – Windows Subsystem for Linux – is a compatibility layer for running Linux binary executables natively on Windows 10 and later. Currently, it supports several Linux distributions, such as Ubuntu, OpenSUSE, and SLES.
With WSL toolchain set up for your project, you can build using a toolchain from Linux, and run/debug on WSL, without leaving WebStorm running on your Windows machine.
Configure WSL
Download and install a WSL distribution (for instance, Ubuntu) from Microsoft Store.
For this step, be sure to use at least Windows 10 or later with the latest “Fall Creators Update” (minimum version 1709, build 16299.15). See the official guide Install the Windows Subsystem for Linux for instructions.
To work with WSL 2, your Windows version should be 10 build 18917 or later. Follow these instructions to switch the distributive.
Run the Linux distribution.
Upon the first launch, the system may prompt you to enable the Windows optional feature. In this case, you need to do the following:
Open Windows PowerShell as Administrator and run
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-LinuxRestart your computer.
Install Node.js and npm
Inside the Linux (Ubuntu) installation, make sure nvm, Node,js, and npm are installed. For the detailed installation instructions, refer to Install Node.js on Windows Subsystem for Linux.
Open the Terminal (Alt+F12.
Install
cURL
:sudo apt-get install curlInstall
nvm
:curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bashInstall the stable Long Term Service Node.js version or the current release version by running one of the following commands:
nvm install --lts nvm install node
Configure a WSL-based Node.js interpreter
You can set a Node.js installation as the default interpreter for the current project or you can configure and use this Node.js version in a Node.js Run/Debug configuration.
In the Settings dialog (Ctrl+Alt+S) , go to .
Click next to the Node Interpreter field, in the Node.js Interpreters dialog that opens, click , and then select Add WSL from the list.
In the Add WSL Node Interpreter dialog that opens, select the Linux distribution you’re using and specify the path to Node.js.
Firewall configuration
You need to perform the following steps to ensure that the building of a project works properly.
Configure firewall settings
Run the Windows PowerShell as administrator.
Execute the following command to allow connections using WSL:
New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow
Then execute the command to renew the firewall rules:
Get-NetFirewallProfile -Name Public | Get-NetFirewallRule | where DisplayName -ILike "IntelliJ IDEA*" | Disable-NetFirewallRule
Now start the debugger session. When the Windows Firewall popup appears, select the Public networks checkbox.