Installing NPM/NodeJS on CentOS is a nightmare

Have been trying for a few hours to install node on CentOS 7.7 to no avail. Cmon guys yum install node/nodejs/npm should just work.

  • yum install node No package node available.
  • yum install nodejs No package nodejs available.
  • yum install nodejs12 No package nodejs12 available.
  • yum list *node*: Nothing related to nodeJS/NPM
  • sudo yum -y install nodejs npm: No package nodejs available. No package npm available.
  • curl -L -k https://npmjs.org/install.sh | sh: Failed to download script
  • Every other googled technique -> fail
  • Guidance on npm.org for CentOS (yum install nodejs12) -> nope, see above

What’s a boy to do?

Workaround for now:

curl -Lk https://git.io/n-install | bash
n 12.13.0

To make node and npm globally available (to any user):

sudo ln -s ~/n/n/versions/node/12.13.0/bin/node /usr/bin/node
sudo ln -s ~/n/bin/npm /usr/bin/npm

Voila:

node -v
v12.13.0

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.