In case you faced an issue building and running your dhis2 web apps while using Powershell or Command Prompt while on Windows, you’re adviced to use the Windows Subsystem for Linux. Furthemore, if you are used to using Visual Studio Code then you will not notice any difference between using it on Linux or on Windows.
- First, make sure that you have WSL2 in your system. Run in your terminal
wsl -l -vso if you see under VERSION the number 2, then WSL2 is installed.
If WSL2 is not in your system then use the following guide to install it, click here
- Second, install a Linux system, I recommend to install Debian so you’re able to follow the developers guides on developers.dhis2.org (but if you already have Ubuntu then go for it!)
If you've not installed a linux system, you can use the following guide, click here
- Third, Install VS Code and the Remote WSL extension, and when you do that two very important points to make sure you don’t miss:
- check the Add to PATH option during installation
- Install the Remote Development extension pack
- Install Git (and this is very important so you can clone and use your projects in the WSL directory because if you use the Windows directory on WSL you will face performance issues)
You can use the following official guides to install VSCode and Git, click here
- To install VSCode (Get started using VS Code with WSL | Microsoft Docs)
- To install Git on WSL (Get started using Git on WSL | Microsoft Docs)
- Finally, Once you have VSCode running with the remote-wsl-extension, you can type
Ctrl+P >(or F1) and then type Remote-WSL. You will see a number of options but the first time, it’s recommended that you choose New Window in WSL and then use the terminal
Ctrl+Shift+`to clone the git repository (if it’s already on github) to the WSL directory.
Thank you! Please feel free to comment and share updates or issues during this process. If you need more clarification on any of the instructions please post back!