转自: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. 在Salesforce中用Data Loader去批量处理数据

    Data Loader download file: Setup --> Administration Setup --> Data Loader --> Download the ...

  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. 枚举PEB获取进程模块列表

    枚举进程模块的方法有很多种,常见的有枚举PEB和内存搜索法,今天,先来看看实现起来最简单的枚举PEB实现获取进程模块列表. 首先,惯例是各种繁琐的结构体定义.需要包含 ntifs.h 和 WinDef ...

  4. 【Web前端】---js调用本地应用程序

    最近进入了一个项目组,向大牛们一起学习如何搞开发,可谓是边开发边学习.就在前两天,我们的项目被领导们验收了一次,顺便给我们提了点新的需求,要求我们能够使用外在设备拍照上传.君要臣死,臣不能不死.更何况 ...

  5. java jdbc sqlhelper

    package com.shop.util; import java.sql.*; //SqlHelper类 //定义了数据库连接函数,关闭查询结果集,关闭Statement对象,关闭数据库连接 // ...

  6. react-redux(2)

    中间件 机制: 建立一个store.dispatch的链条,每个middleware是链条中的一个环节,传入的action对象逐步处理,直到最后出来是Javascript Plain Object; ...

  7. 学习 Message(5): 关于 TApplicationEvents.OnMessage 的第二个参数 可以屏蔽 TWebBrowser右键菜单:

    http://www.cnblogs.com/del/archive/2008/10/25/1319318.html TApplicationEvents.OnMessage 的第二个参数 Handl ...

  8. three.js 显示一个绿色的正方体

    第一个框架的效果是显示一个绿色的正方体 <!DOCTYPE html> <html> <head> <title></title> < ...

  9. node.js文件系统

    FS文件系统 第一次用这个的时候非常爽,可以在代码层编写“增删改查”文件的功能.分解里面提供的方法,接下来我们从头创建开始,最后删除文件结束,一套流程接下fs文件系统的神奇. 要使用fs文件系统就要引 ...

  10. 使用expdp时遇到ORA-39002、ORA-39070错误

    使用expdp时,遇到”ORA-39002.ORA-39070......”连续报错. 1.  遇到的问题 expdp yguo/dbimp@botnet schemas=yguo dumpfile= ...