Working on Ec2 on AWS.
I have installed Node.js and it works fine.
But the problem arises when trying to install npm.
I am using the following command to install it:
sudo curl http://npmjs.org/install.sh | sh
But the install seems to freeze... I get "fetching: http://registry.npmjs.org/npm/-/npm-1.0.106.tgz" at the prompt and it stays on like this.
Have any idea what is going on here?
sudo yum install nodejs npm --enablerepo=epel
To install NodeJS 6.x execute the following commands:
curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash - yum install nodejs --enablerepo=nodesource
You can install NodeJS 7 and 8 in the same way. Just specify the version you need instead of 6 in the command above.
To update to NodeJS 10 (or any other version) do the following:
rm -rf /etc/yum.repos.d/nodesource-el* curl -sL https://rpm.nodesource.com/setup_10.x | sudo -E bash - yum install nodejs --enablerepo=nodesource