在AWS EC2上安装NPM [英] Installing NPM on AWS EC2

查看:210
本文介绍了在AWS EC2上安装NPM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在AWS上的Ec2上工作。



我已经安装了Node.js,并且工作正常。



但是尝试安装npm时会出现问题。



我正在使用以下命令进行安装:

  sudo curl http://npmjs.org/install.sh | sh 

但是安装似乎冻结了……
我得到获取: http://registry.npmjs.org/npm/-/npm-1.0.106

不知道这是怎么回事吗?

按照此 AWS教程 >节点版本管理器。



节点版本管理器(NVM)可让您安装Node.js的多个版本并在它们之间进行切换。






以下步骤为:



安装NVM

  curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install .sh | bash 

激活NVM

 。 〜/ .nvm / nvm.sh 

安装节点(选择版本)

  nvm安装4.4.5 

确认安装成功

  node -e console.log('Running Node.js'+ process.version) 


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?

解决方案

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)"

这篇关于在AWS EC2上安装NPM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆