-
Notifications
You must be signed in to change notification settings - Fork 54
Linux and WSL Setup
We recommend using Docker containers during futureproof - and beyond!
For more details on other options for local env setup for Linux, check out the Optional section below.
Linux
If you are on Linux machine (as opposed to running WSL in Windows), skip to Setting up your environment.
This guide is based on an Ubuntu 18.04 Bionic distro but can be adjusted to suit.
WSL on Windows 10
If you are running Windows 10, you have the option of accessing the Windows Subsystem Linux.
There was a major update to WSL in May 2020 so make sure you know which one you are using / aiming to use whilst setting up, debugging and working in your environment. Be aware that since WSL 2 is (at time of writing) a very recent release, there may be a lot of guides that refer to the original WSL. If the article does not specify, it is likely to be referring to WSL 1. Check out the official comparison docs here. If you can't decide and you are starting from scratch, go for WSL 2.
NB: WSL2 requires a Windows 10 build of 19041 or higher
The official guide is excellent and we recommend working through it as your primary source. When choosing your distro, Ubuntu is a solid choice and has lots of great documentation but if you prefer something else, go for it! The rest of this guide will be based on an Ubuntu install.
In your Linux terminal run: sudo apt-get update
(this command may differ depending on your Linux distro)
- Run:
git --version
to see if you have git installed. - If git is not installed, find your appropriate install command here or run:
brew install git
(see Install Homebrew below). - To configure it to connect to your GitHub account run:
git config --global user.email “[email protected]”
git config --global user.name “yourGithubUsername”
- Run:
ssh-keygen
and follow the instructions. If it asks if you want to overwrite, say no. - If you get stuck in this process, this walk-through gives detailed info on each step.
- Visit the GitHub SSH keys settings page in your browser and click ‘New SSH Key’
- Give it a title (anything you want to indicate the machine this key is for) and paste in your key.
Complete this practice repo using the accompanying walkthrough!
Although we will use Docker for many things, we will also install node locally for some global use tools that we may use.
- Download and install nodejs using the official installation guides
- Confirm your node installation
- In your terminal, run
node -v
- If you see a version number eg.
v18.16.1
then your install was successful! - You should also get version numbers back for
npm -v
andnpx -v
- In your terminal, run
- Install your first global node package
npm install -g laughs
-
ha
- wait for a joke!
Your package manager will depend on the Linux distro you chose. In Ubuntu your installs will generally follow the pattern of:
sudo apt-get install <package-name>
. Often you will be searching for the 'binaries' of packages/apps. Check out this documentation for installing nodejs on Ubuntu and Debian distros.
nvm is a great tool that lets us switch between node versions. This can be extremely useful when working with others.
Homebrew is a popular package manager for Mac & Linux applications.
For more information on our transformative coding education, visit us at https://www.lafosseacademy.com/