Skip to content

Instantly share code, notes, and snippets.

@Sayan-Roy-729
Last active June 18, 2021 12:35
Show Gist options
  • Save Sayan-Roy-729/e432fe2018c54e692e556a8af87fcb3f to your computer and use it in GitHub Desktop.
Save Sayan-Roy-729/e432fe2018c54e692e556a8af87fcb3f to your computer and use it in GitHub Desktop.
Install Node, npm and Yarn on VPS

Install Node, npm and Yarn on VPS:

Update pre-intstalled packages:

sudo apt update

Install curl:

sudo apt-get install curl

Install Node & npm:

Enable Node source (Execute 1st command for latest version or 2nd for lts version)

curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
OR
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -

Install node

sudo apt-get install nodejs

Now Check installed node and npm version.

Install 'yarn':

Add GPG Key

curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -

Enable Yarn Repository

echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

Update Cache & Install Yarn

sudo apt update && sudo apt install yarn

Now check the installed yarn package and that's it.

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