author Magesh

Install NodeJS and Yarn

Magesh Ravi on Aug. 19, 2022


Install the latest LTS version of NodeJS (v16.x)

curl -fsSL | sudo -E bash -
sudo apt-get install -y nodejs

Setting a folder for global installations,

# create new folder
mkdir ~/.npm-global

# configure npm to use the folder
npm config set prefix '~/.npm-global'

Finally, add the following line to your ~/.zshrc file.


Reload Zsh config for changes to take effect.

source ~/.zshrc


Install yarn via NPM

npm install --global yarn

# check version
yarn --version