Hi, in class we had a little trouble with Windows systems so I figured I'd make a recommendation as to how to install WSL on Windows and connect it to VSCode if anyone struggles with getting the environment set up.
WSL is a subsystem that lets you run a GNU/Linux environment on Windows. Certain node apps can react strangely when crossing platforms and it's a pain to have to adapt them, so having this setup beforehand can help with a lot of those issues.
I was introduced to this in my bootcamp, which tried its best to accommodate windows developers but often struggled with shifting standards, versions and dependencies. It was kind of buggy back then, but today it seems more stable and has lots of fun features.
EDIT - I forgot! Before doing any of this, you might have to enable virtualization on your BIOS. That is particular to whatever PC you might have. Windows may prompt you if it isn't on and you try to install wsl. You may be out of luck if this isn't a feature on your system.
1 - Open an admin-level command window or Powershell and run wsl --install
for the default Ubuntu distribution. If you accidentally load WSL without a distro (I somehow managed to do this), you can find the latest version of Ubuntu for WSL here.
2 - It may take a minute to load the first time. When you open it, it appears as a command window. Linux will ask you to create a username and password.
3 - Once this is set up, you should be able run sudo apt update
followed by sudo apt upgrade
to make sure all your dependencies are up to date, using your password when prompted.
4 - While in WSL, not cmd or powershell, Install Node, npm and yarn in one go by running each of the following lines:
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install yarn
yarn should install node for you. You should also check that the version meets the minimum in the project using yarn --version
and update packages if necessary.
5 - Now open VSCode. It may detect that you've installed WSL and recommend you install some extensions to help it run better. Install Remote - WSL
& Remote Development
.
6 - Hit shift+ctrl+p
and select Remote-WSL: New WSL Window
. It will open a new window that will allow you to work directly in your distro.
6 - If you like using the terminal in VSCode, you can now open a WSL terminal. In a fresh window, it starts you on a path that is equivalent to your c:/.../Users/[yourUsername] path. cd
or mkdir
into whatever development folder you want to use.* Otherwise, you can open an Ubuntu terminal by searching for Ubuntu (I'd also pin it to my taskbar for now).
*To avoid potential nasty interactions with Windows on your existing apps, build on your distro's /home/user/etc... and not on /mnt/c/etc... in WSL 2, npm will slow down and crash horribly on a lot of processes. See https://docs.microsoft.com/en-us/windows/wsl/filesystems for more
If you follow the rest of the directions for setup as described in the course, starting from installing Volta, you should be able to work from here.
src - https://docs.microsoft.com/en-us/windows/wsl/install, https://code.visualstudio.com/docs/remote/wsl-tutorial