Stop! The following instructions pertain to units 2-4 - revisit this section in unit 2!
We're going to install Node.js using a tool called Node Version Manager (NVM for short). Node has been around for a while and has many versions available for us to use. We're going to focus on the latest Longterm Support (LTS) version for our work in the course.
- Run the following command to download and run the
nvm
install script viacurl
:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
-
Important Note! If you've installed or plan to install Zsh and use that instead of bash, you will need to come back and run the following command after having installed Zsh:
# Run this command instead if you're using Zsh curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | zsh
-
Double check that NVM installed correctly with:
nvm --version
- Finally we're ready to install Node. We want the latest LTS version. To get it and use it, run these commands:
nvm install --lts
Your console should display a progress bar during installation. Wait for this to complete before continuing.
- Use the lts version of node.
nvm use --lts
-
Set the default Node version.
nvm alias default node
When it comes to installing database technologies - WSL has a handful of extra configuration steps as the installations will not work by default.
# Create the file repository configuration:
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
# Import the repository signing key:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
# Update the package lists:
sudo apt-get update
# Install the latest version of PostgreSQL.
# If you want a specific version, use 'postgresql-12' or similar instead of 'postgresql':
sudo apt-get -y install postgresql
By default on WSL - running the psql
command will give you an error similar to:
psql: error: FATAL: role "<your_user_name>" does not exist
- Run the following commands one by one, but change
<your_user_name>
to your linux username!
# Auto start the postgres server
sudo -u postgres pg_ctlcluster 13 main start
# Start the postgres server the first time
sudo service postgresql start
# Create a postgres user that matches your username
sudo -u postgres createuser <your_user_name>
# Create a postgres database that matches your username
sudo -u postgres createdb <your_user_name>
# Run psql as the postgres user
sudo -u postgres psql
- The last command will bring you inside of the
psql
shell - run the following command
ALTER USER <your_user_name> WITH SUPERUSER;
When it comes to installing database technologies - WSL has a handful of extra configuration steps as the installations will not work by default.
- Run the following commands one by one:
sudo apt install mongodb
sudo service mongodb start
- Test if it worked by running the
mongo
command, and also try themongosh
command. If you are in the mongo shell, then it worked! - If it didn't work, and you get an error referring to
/data/db
- run the following:
sudo mkdir -p /data/db
sudo chmod 777 /data/db
mongod --dbpath /data/db
Python install instructions - run the following commands in your terminal
# install python
sudo apt-get install python3
sudo apt-get install python3-pip
In your ~/.zshrc
file, add the following lines
# Alias python to python3
alias python=python3
alias pip=pip3
# To allow pip packages to be in PATH
path+=(/home/<your_user_name>/.local/bin)
- Read this intro
- [✔️] Alternative OS intro
- Prior to the first day of class: Enable WSL and Install Ubuntu from the Microsoft Store app
- [✔️] WSL Setup
- On the first day of class, your instructors will help you with Installfest
- [✔️] Installfest
- Optional visual and usability upgrades for your terminal
- [✔️] Upgrades
- Unit 2-4 Installfest