How to install Node, Yarn, Git and VSCode on Linux, Mac and Windows

On Linux (Ubuntu 20.04 LTS):

Download the Node LTS archive file from https://nodejs.org/ and extract it (in this example, the archive is extracted is /home/user/Downloads/)

Open .bashrc in the home folder (/home/user./bashrc) with a text editor, and append:

PATH=$PATH:/home/user/Downloads/node-v14.17.0-linux-x64/bin

Then, in a terminal:

source .bashrcnode -v
# v14.17.0
npm -v
# 6.14.13

You may also need the development tools to build native addons:

sudo apt install gcc g++ make

Alternatively, you can install Node from a package. To install the LTS version, go to https://github.com/nodesource/distributions and

# You need to install curl if it's not already installed
sudo apt install curl

# Ubuntu
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs

Install Yarn (from https://yarnpkg.com/getting-started/install)

npm install -g yarn

yarn -v
# 1.22.10
sudo apt install git

Download the .deb package from https://code.visualstudio.com/. Then, in a terminal, go to the Downloads folder, and:

sudo dpkg -i code_1.57.0-1623259737_amd64.deb

# test it
code .

On Mac

Download the LTS package from https://nodejs.org and install it (double click on node-v14.17.1.pkg and follow the steps).

Then open a terminal, and:

node -vnpm -v

Open a terminal, and:

npm install -g yarnyarn -v

NOTE: if you get this error: “npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/yarn” run the following commands:

sudo chown -R $USER /usr/local/lib/node_modules 
sudo chown -R $USER /usr/local/bin
sudo chown -R $USER /usr/local/share/

Then try to reinstall yarn with the command above.

First, install Homebrew by following the instructions here: https://brew.sh

Then, install Git with:

brew install git

Download the package from https://code.visualstudio.com and install it.

On Windows

Download Nodejs LTS from https://nodejs.org and install the package — don’t forget to check “Automatically Install the Necessary Tools” in the installer.

Then, open a terminlal (Command Prompt) and:

node -vnpm -v
npm install -g yarnyarn -v

Download the executable from here https://git-scm.com/download/win and run the installer.

Then, open a terminal and:

C:\Users\user>git --version
git version 2.32.0.windows.1

Download VSCode from https://code.visualstudio.com/ and run the installer.

Then, to test everything, open a Command Prompt and:

git clone https://github.com/alexadam/project-templates.gitcd projects\react-appyarn init --yesyarn add react react-domyarn add --dev @types/react @types/react-dom ts-loader css-loader html-webpack-plugin node-sass sass-loader style-loader typescript webpack webpack-cli webpack-dev-server# Open VSCode
code .

Open package.json and append these lines:

,"scripts": {
"clean": "rm -rf dist/*",
"build": "webpack",
"dev": "webpack serve"
}

Run yarn dev, open a browser and go to http://localhost:8080/

--

--

--

https://alexadam.dev/

Love podcasts or audiobooks? Learn on the go with our new app.

Intro to Redux (React-Redux).

Notes on Prototype Inheritance and Composition in JS

How The React JS is Changing Front-End Development

Creating a Bug Report Form in GitHub

A Faint Outline

Creating Dynamic Discord Bots with JavaScript ES6 and Realm

React Hooks — A Conceptual Overview

Node.js REST API with RBAC, JWT, Repository and MVC pattern. Part 3.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
alex adam

alex adam

https://alexadam.dev/

More from Medium

Backup your database using cron

Getting started with Git: made easy

How to install JDK on mac M1/aarch64/ARM natively

VS Code Remote Container User