If you're a developer or a power user who loves Linux but also needs to use Windows for work, you know how frustrating it can be to switch between two operating systems. That's where WSL comes in.
WSL (Windows Subsystem for Linux) is a technology that allows you to run Linux applications natively on Windows. This means that you can use all of your favorite Linux tools and applications on your Windows machine, without having to dual-boot or use a virtual machine.
Enable Windows-Subsystem-Linux (WSL):
From the start menu, search for PowerShell and run it as an administrator.
Run the command below. It will require a full reboot of your system.
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
After rebooting check if is it installed.
wsl
Install a Linux Distro:
Open the Microsoft store and search for Linux. Choose your preferred distro - choose Ubuntu LTS if you don’t have a preference.
Install Windows Terminal :
Windows has a new terminal app that makes it easier to work with the command line. Install it quickly between Linux and PowerShell sessions.
After install :
It will ask to set Username & Password then good to go with linux.
VS Code with WSL
With WSL installed, we need to to connect it VS Code.
Install the Remote WSL Extension
The Remote WSL extension makes it possible to use Linux (WSL) as your dev environment in VS Code.
Node.js & NPM
As a web developer, you need Node.js. You can manage multiple versions with NVM.
Install Node
Install the recommended LTS version of Node. It will automatically install NPM and Node.
command line
nvm install --lts
node -v
npm -v
I hope this helps!