If you use a windows machine with windows installed on it but also want to work using Linux/Ubuntu environment. There are mainly three approaches. (There can be more)
- Virtual Machine
- Dual Boot
I would recommend you WSL because of two reasons. One, the first two approaches would be required a lot of resources like RAM and Hard Drive memory, etc. WSL consumes minimal resources and secondly, it allows you to export its image and import it on another computer within minutes.
Enable Windows Subsystem for Linux
Open Start on Windows 10.
Search for Turn Windows features on or off and click the top result to open the experience.
Check the “Windows Subsystem for Linux” option.
Click the OK button.
Click the Restart button.
Enable Virtual Machine Platform
Open Start, Search for PowerShell, right-click the top result, and select the Run as administrator option.
Type the following command to enable the Virtual Machine Platform feature and press Enter:
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
Install WSL2 on Windows 10
Search for Command Prompt, right-click the top result, and select the Run as administrator option.
Type the following command to install the WSL on Windows 10 and press Enter:
Another way is to go to the Microsoft store and install Ubuntu 18.04.
Once you install Ubuntu run following commands.
sudo apt update
sudo apt-get install curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
nvm install 16
sudo apt-get install build-essential
Now go to your home directory and install react js app.
npx create-react-app my-app-on-wsl
You may face a permission error (mostly this occurs with the Next JS app). To resolve this error you need to give app folder permission to your user as well.
I hope this would be helpful for you guys. Do like and follow for more updates.
Top comments (0)