Install Node.js, npm and Yarn

node.js logo

Normally, it is recommended to install the latest even-numbered LTS of Node.js, which currently is 12.13.1 and includes npm 6.12.1.

But a vulnerability in npm was recently disclosed, so you should probably install the latest official release (V13) to stay safe. Use the commands, found here:
https://github.com/nodesource/distributions/blob/master/README.md#debinstall

Install Node.js v13.x

$ curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
$ sudo apt-get install -y nodejs

Versions

$ nodejs -v
v13.6.0

$ npm -v
6.13.4

Install stable version of Yarn

Follow the directions on the official Yarn installation page: https://yarnpkg.com/lang/en/docs/install/#debian-stable

$ yarn -v
1.21.1