Skip to content

Instantly share code, notes, and snippets.

@benchristel
Last active December 9, 2024 21:30
Show Gist options
  • Save benchristel/ede6615bf1c6cf91fd5cda70f02f57d7 to your computer and use it in GitHub Desktop.
Save benchristel/ede6615bf1c6cf91fd5cda70f02f57d7 to your computer and use it in GitHub Desktop.
Setting up a JavaScript Development Environment

Setting up a JavaScript Development Environment

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 updates node 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!

Installing nvm

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.

Installing node

Once you have nvm, installing the latest version of node is just:

nvm install node

See nodejs.org for more info about node.

Installing yarn

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment