At this point, you and your system are totally ready to start developing, so lets get some helpful developer tools and software downloaded and installed.
This section will also talk about why to install something on Windows vs Ubuntu vs Both.
After finishing this doc you will have VSCode, Node.js, and Git installed on your machine.
VSCode is a code editor that comes with many helpful features to streamline your development process. It also comes with an integrated terminal, debugging capabilities, and a very helpful built-in source control UI.
VSCode is where you will doing the vast majority of your work. Since VSCode relies on a GUI, this will be installed on through Windows, not Ubuntu.
Additional tasks
, make sure every box is checked.Once you are done, you can open up a terminal (the Ubuntu App) and type code
to open VSCode. This may or may not require a restart first.
Notice how Ubuntu knows about a program that is installed on the Windows FS? This is because WSL is able to connect both PATHs together!
JavaScript was initially run client-side in the browser, but the with addition of Node.js, it gained back-end capabilities. Node.js is a runtime environment built off of Chromes V8 JavaScript engine.
You will be using Node.js to add tools, libraries, and frameworks to your projects, and you will also use it as a REPL environment for working on your code.
We will be installing Node.js through the Ubuntu Command Line Interface, using Ubuntu’s apt. We are installing it on the Ubuntu FS because it is software that does not need a GUI and we want it to run in a POSIX environment.
cd ~
to bring you into the Ubuntu FS.sudo apt-get update
. This will tell Ubuntu’s apt tool to update.curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
The first line will handle getting everything ready. The second line will show up once the first line has finished. Press enter when the second line shows up in your terminal.
node -e 'console.log("works")'
works
then you’re all good to go!We will also install Node on Windows, as you’ll need the ability to use Node on Windows in order to install tools that VSCode uses. Since VSCode is a Windows app, it can’t use tools we install with Node on Ubuntu; we have to use Node on Windows.
npm i -g eslint
.Git is a version control system that allows you to track your projects’ changes over time, and allows for an extremely collaborative process to exist.
In our case, we have an uncommon situation when it comes to Git. Git is already installed on Ubuntu as it comes built in and ready to use right out of the gate, so that’s totally good to go.
VSCode however also uses Git for it’s source-control tool to work. But since VSCode is a Windows application, it doesn’t know how to use Ubuntu’s version of Git. On top of that, if VSCode ever needed to manipulate one of the Ubuntu Git’s files, it would break since Windows Applications cannot manipulate Ubuntu Files.
This is why it is recommended that as much of your software is installed on Ubuntu as possible, so that they can talk to each other and update each other’s files easily. In this case, we needed VSCode on Windows, and it just so happened that VSCode needs git, so in these situations, it is totally fine to install both pieces of software on the Windows FS.
But now there are two versions of Git installed right? Correct. The nice thing about WSL is that because of the way the PATH is setup, it knows which one to use and when. More on that after we install Git on Windows.
Choose the default editor used by Git
, click the drop down and choose the VSCode option.NOTE: Git for Windows also comes with a terminal called Git Bash. This is what a lot of Windows users have used in the past as their solution to the POSIX / Unix-like terminal problem. We will be using the Ubuntu app instead.
Now that we have Git installed on both of the file systems, lets check which Git Ubuntu is using.
whereis git
. This will show you all the places git is on your computer.which git
. This will show you which git is executed when you type git
. Notice that it only shows the one in Ubuntu - that is the git that will be used when you are in your terminals.code
to open VSCode.Ctrl + Shift + U
to open the output section. To the right of the output there is a drop down. Choose the one that says Git.Using git 2.17.0.windows.1 from C:\Program Files\Git\cmd\git.exe
The final step here is to add your email and name to the Git config. This will allow you to commit and push things to GitHub. Make sure to include the space after .email
and .name
, and always remember to close your quotes ‘ ‘ and “ “.
git config --global user.email 'your email here in single quotes'
.git config --global user.name 'Your Name In Single Quotes'
.git config --global core.editor nano
. (If you’re a fan of emacs
or vim
, feel free to use that as your default editor instead of nano
.)Once you are done, type git config -l
and verify that it has your name, email, and editor saved correctly.
Now is a good point to quickly review everything we’ve done so far
At this point you are totally setup to start programming! There are two final sections left to complete. They will cover: