CentOS 7 - nodejs

Install from nodesource repository

Nodejs major version can be replaced in following command (from 14 to e.g. 12 or 10, ...)

# curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -
# yum -y install nodejs
# node --version
# npm --version

Yarn

# curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
# yum install yarn