转自:https://rtcamp.com/tutorials/nodejs/node-js-npm-install-ubuntu/

Compiling is way to go for many but I am mostly in hurry so following works for me!

Adding Chris Lea’s Repo

Using Launchpad repo by Chris Lea just run following commands

apt-get install python-software-properties
apt-add-repository ppa:chris-lea/node.js
apt-get update

node.js install

apt-get install nodejs

Check node.js version

node -v

Outputs

v0.10.20

npm install

Above command should install npm.

Check npm version

npm -v

Outputs

1.4.3

If for some reason, if you see npm is not installed, you may try running:

apt-get install npm

(updated on 20 Feb 2014. After this comment from dodyrw

21 Comments

  1. Perfect, Thank you this was very helpful. I needed to install the latest node.js & npm to use the new ghost blogging platform.

  2. Followed your instructions, but I got the following error when trying to install npm:

    user@system:~$ sudo apt-get install npm

    Reading package lists… Done

    Building dependency tree

    Reading state information… Done

    Some packages could not be installed. This may mean that you have

    requested an impossible situation or if you are using the unstable

    distribution that some required packages have not yet been created

    or been moved out of Incoming.

    The following information may help to resolve the situation:

    The following packages have unmet dependencies:

    npm : Depends: nodejs but it is not going to be installed

    Depends: nodejs-dev

    Depends: node-request but it is not going to be installed

    Depends: node-mkdirp but it is not going to be installed

    Depends: node-minimatch but it is not going to be installed

    Depends: node-semver but it is not going to be installed

    Depends: node-ini but it is not going to be installed

    Depends: node-graceful-fs but it is not going to be installed

    Depends: node-abbrev but it is not going to be installed

    Depends: node-nopt but it is not going to be installed

    Depends: node-fstream but it is not going to be installed

    Depends: node-rimraf but it is not going to be installed

    Depends: node-tar but it is not going to be installed

    Depends: node-which but it is not going to be installed

    E: Unable to correct problems, you have held broken packages.

    Could it be my version of nodejs?

    user@system:~$ node -v

    v0.10.25

Latest node.js & npm installation on Ubuntu 12.04的更多相关文章

  1. Installing OpenCV 2.4.10 in Ubuntu 12.04 LTS

    转自 http://www.samontab.com/web/2012/06/installing-opencv-2-4-1-ubuntu-12-04-lts/ EDIT: I published a ...

  2. (转) How to install eclipse in ubuntu 12.04

    源地址:http://www.krizna.com/ubuntu/install-eclipse-in-ubuntu-12-04/ Eclipse installation in ubuntu 12. ...

  3. ubuntu 12.04 安装node.js

    在 Ubuntu 12.04 安裝 Node.js 使用 nvm(Node Version Manage) 來安裝 node.js, 預先需要 curl, git, g++ : $ sudo apt- ...

  4. Angularjs学习---angularjs环境搭建,ubuntu 12.04下安装nodejs、npm和karma

    1.下载angularjs 进入其官网下载:https://angularjs.org/‎,建议下载最新版的:https://ajax.googleapis.com/ajax/libs/angular ...

  5. Node.js NPM Package.json

    章节 Node.js NPM 介绍 Node.js NPM 作用 Node.js NPM 包(Package) Node.js NPM 管理包 Node.js NPM Package.json Nod ...

  6. Node.js npm

    Node程序包管理器(NPM)提供了以下两个主要功能: 在线存储库的Node.js包/模块,可搜索 search.nodejs.org 命令行实用程序来安装Node.js的包,做版本管理和Node.j ...

  7. 自制node.js + npm绿色版

    自制node.js + npm绿色版   Node.js官网有各平台的安装包下载,不想折腾的可以直接下载安装,下面说下windows平台下如何制作绿色版node,以方便迁移. 获取node.exe下载 ...

  8. Installing Node.js and Express on Ubuntu

    Installing Node.js and Express on Ubuntu 1. 在nodejs官网上下载Linux Binaries(已经包含了npm):2. 安装Node.js下载后解压,并 ...

  9. Node.js NPM Tutorial

    Node.js NPM Tutorial – How to Get Started with NPM? NPM is the core of any application that is devel ...

随机推荐

  1. 监听报错 TNS-00525: Insufficient privilege for operation 11gR2 + 连接报错ORA-12537: TNS:connection closed

    1.TNS-00525: Insufficient privilege for operation Started with pid= Listening on: (DESCRIPTION=(ADDR ...

  2. SGU 275 To xor or not to xor 高斯消元求N个数中选择任意数XORmax

    275. To xor or not to xor   The sequence of non-negative integers A1, A2, ..., AN is given. You are ...

  3. python学习第三天

    小结: 总体上,python是解释型语言,开源比较好,速度较慢,装逼神器,解释器较常用的是CPython,安装后python进入运行环境 exit()退出 第一个hello world : print ...

  4. NuGet 发布

    其实吧,我并没有用到nuget发布,但是在做项目的过程中,我需要别的系统给我接口,所有吧,人家就发 布了了一个nuget程序集,而我呢,就引用了一下,然后就可以用了,又不吧,本人小编好奇心比较重,所以 ...

  5. SQL单表查询案例

    表(emp)结构 (1)查询部门编号为10中所有经理,部门编号为20中所有销售员,还有即不是经理又不是销售员但其工资大或等于20000的所有员工详细资料. SELECT * FROM emp ; (2 ...

  6. POJ 3067 Japan(经典树状数组)

    基础一维树状数组  题意:左边一排 1-n 的城市,右边一排 1-m 的城市,都从上到下依次对应.接着给你一些城市对,表示城市这两个城市相连,最后问你一共有多少个交叉,其中处于城市处的交叉不算并且每个 ...

  7. try : finally语句

    try:finally语句不管有没有异常他都会执行:他就是用来清理的try: h=open("ll","r") y=h.read() print (int(y) ...

  8. Python与Hack之window下运行带参数的Python脚本,实现一个简单的端口扫描器

    1.前提是:windows已经配置好Python的环境变量: 2.进入cmd命令行模式: **输入python命令,检测是否环境配置好:显示这样说明配置环境变量没问题 **用cd命令进入Python脚 ...

  9. Swift3.0语言教程获取字符

    Swift3.0语言教程获取字符 Swift3.0语言教程获取字符,在字符串中获取某一下标位置(下标索引)处的字符是很常见的功能,在NSString中使用character(at:)方法实现,其语法形 ...

  10. iOS 含有 中文的URL 转码问题

    非ARC模式下: - (NSString *)encodeToPercentEscapeString: (NSString *) input { NSString *outputStr = (NSSt ...