Welcome to the wonderful world of JavaScript development! I hope you find it enjoyable and rewarding.
The basic tools of the JS trade these days are:
node
, which runs JavaScript code.nvm
(Node Version Manager), which updatesnode
and lets you switch between different versions.yarn
, a package manager for installing projects' dependencies.
Once you have these tools on your system, you will be able to download and run most JS projects, as well as create your own!
See NVM on GitHub.
TL;DR you'll run a command like this:
# It's HIGHLY RECOMMENDED to copy the install command from
# https://github.com/nvm-sh/nvm instead of using this one.
# Depending on when you are reading this, the NVM version
# given here may be out of date.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
Then you'll need to close and reopen your terminal to make the nvm
command available in your shell.
If command -v nvm
prints nvm
, you should be good to go.
Once you have nvm
, installing the latest version of node
is just:
nvm install node
See nodejs.org for more info about node
.
node
comes with its own package manager, npm
, but many projects these days use an alternative, yarn
.
You can install yarn
by running:
npm install --global yarn@1.22.15
If which yarn
outputs a path, it worked.