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
Get the http://npmjs.org/install.sh
file on your system first and then execute it directly instead of piping with curl.
chmod +x install.sh
to make it executable./install.sh
Edit as my answer wasn't pertinent anymore:
Try:
curl --silent --location https://rpm.nodesource.com/setup | bash -
yum -y install nodejs
https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#enterprise-linux-and-fedora-core
Follow this AWS Tutorial that uses Node Version Manager.
Node Version Manager (NVM) lets you install multiple versions of Node.js and switch between them.
Here are the steps:
Install NVM
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh | bash
Activate NVM
. ~/.nvm/nvm.sh
Install Node (choose version)
nvm install 4.4.5
Confirm Successful Installation
node -e "console.log('Running Node.js ' + process.version)"