Instalación de NPM en AWS EC2
Trabajando en Ec2 en AWS.
He instalado Node.js y funciona bien.
Pero el problema surge cuando se intenta instalar npm.
Estoy usando el siguiente comando para instalarlo:
sudo curl http://npmjs.org/install.sh | sh
Pero la instalación parece congelarse... Me sale "fetching: http://registry.npmjs.org/npm/-/npm-1.0.106.tgz " en el prompt y permanece así.
¿Tienes alguna idea de lo que está pasando aquí?
7 answers
sudo yum install nodejs npm --enablerepo=epel
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-02-11 19:05:47
Para instalar NodeJS 6.x ejecute los siguientes comandos:
curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash -
yum install nodejs --enablerepo=nodesource
Actualización
Puede instalar NodeJS 7 y 8 de la misma manera. Simplemente especifique la versión que necesita en lugar de 6 en el comando anterior.
Actualización
Para actualizar a NodeJS 10 (o cualquier otra versión) haga lo siguiente:
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
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-09-26 18:12:05
Siga este Tutorial de AWS que utiliza Node Version Manager.
Node Version Manager (NVM) le permite instalar varias versiones de Node.js y cambiar entre ellos.
Estos son los pasos:
Instalar NVM
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh | bash
Activar NVM
. ~/.nvm/nvm.sh
Instalar nodo (elegir versión)
nvm install 4.4.5
Confirmar La Instalación Correcta
node -e "console.log('Running Node.js ' + process.version)"
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-06-12 22:32:04
Encontré su tutorial que me ha sido muy útil: El último capítulo explica cómo instalar node y compilarlo npm.
Http://iconof.com/blog/how-to-install-setup-node-js-on-amazon-aws-ec2-complete-guide/#installNode
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-10-26 12:23:06
git clone https://github.com/isaacs/npm.git
cd npm
sudo make install
Y si no tienes git, haz esto primero:
sudo yum install git
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-02-11 08:18:42
En primer lugar
Sudo yum install make
Puede ejecutar esto para obtener zip de la versión deseada de node
wget https://nodejs.org/dist/v8.10.0/node-v8.10.0.tar.gz
Entonces puedes descomprimirlo así
tar -xvf node-v8.10.0.tar.gz
Luego vaya al directorio extraído e instale el nodo así
./configure && make && sudo make install
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-05-15 17:07:53
Editar como mi respuesta ya no era pertinente:
Intenta:
curl --silent --location https://rpm.nodesource.com/setup | bash -
yum -y install nodejs
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-10-20 06:26:43