转自: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. javascript settimeout and setinterval

    setTimeout只运行一次,也就是说设定的时间到后就触发运行指定代码,运行完后即结束.如果运行的代码中再次运行同样的setTimeout命令,则可循环运行.setinterval是循环运行的,即每 ...

  2. UVA 12901 Refraction 数学

    题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=83008#problem/E Description HINT 题意: 给你一个 ...

  3. Arduino101学习(一)——Windows下环境配置

    一.Arduino IDE下载 要开发Arduino 101/Genuino 101,你需要先安装并配置好相应的开发环境.下载地址 http://www.arduino.cn/thread-5838- ...

  4. Js图片切换

    <!DOCTYPE html><html<head> <meta charset="UTF-8"> <title></t ...

  5. 关于Vector中的元素中含有指针成员的情况

    对于容器,当容器的各个元素为类类型,且该类类型中含有指针成员时: 如果类类型的析构函数中包含了对指针变量指向内存的释放操作,则在利用clear()函数删除容器所有元素时,会自动调用类的析构函数,自动实 ...

  6. RDLC的部署(无法找到Microsoft.ReportViewer.ProcessingObjectModel.dll文件)

    CMD命令:C:\Windows\assembly\GAC_MSIL\ rdlc 相比微软的其他产品来说,做得还真是够烂的了,比水晶报表也烂得多. 但不知为何我还是宁可先择 rdlc.并且渐渐上手了. ...

  7. DSP using MATLAB示例Example3.6

    代码: n = [-5:5]; x = (-0.9).^n; % x(n) = k = -200:200; w = (pi/100)*k; % [0,pi] axis divided into 101 ...

  8. 手持终端PDA应用固定资产管理系统(资产查询 盘点)软件程序系统

    一.产品概述 固定资产管理系统,是针对企事业单位内部资产管理中出现的工作量大.过程繁琐.追踪困难等一系列难题开发的一套先进管理软件.软件实现了对资产的多种方式管理,目前包括条形码.二维码.RFID管理 ...

  9. ural 1255. Graveyard of the Cosa Nostra

    1255. Graveyard of the Cosa Nostra Time limit: 1.0 secondMemory limit: 64 MB There is a custom among ...

  10. ajax、post、get实例

    html代码: <!DOCTYPE HTML><html lang="en-US"><head> <meta charset=" ...