转自: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

最新文章

  1. (2016弱校联盟十一专场10.3) B.Help the Princess!
  2. Visual Studio 拓展插件——Image Optimizer
  3. 通过反汇编理解函数调用机制(x86和ARM)
  4. iOS——关于创建真机调试证书(发布证书,测试(调试)证书,推送调试证书)、iOS开发者账号申请 请用开发者账号去iTunes connect 查看状态
  5. Linux环境下实现哲学家就餐问题
  6. BZOJ3928 [Cerc2014] Outer space invaders
  7. POJ 1039 Pipe(直线和线段相交判断,求交点)
  8. linux安装问题
  9. 64位系统ADB
  10. C++程序设计实践指导1.6分数运算改写要求实现
  11. 高级软件工程2017第3次作业——结对项目:四则运算题目生成程序(基于GUI)
  12. Jsoup解析获取品花社图片
  13. c++入门之输出文件流ofstream
  14. [CNN] Understanding Convolution
  15. SQL server 清除缓存
  16. XMind 8 Update 7 Pro 激活码
  17. Codeforces 599C. Day at the Beach 模拟
  18. HTML常用头部变量
  19. python discover 函数介绍
  20. [BZOJ4869][六省联考2017]相逢是问候(线段树+扩展欧拉定理)

热门文章

  1. Python3 基本数据类型注意事项
  2. android AsyncTask介绍(转)
  3. HDU 3364 Lanterns 高斯消元
  4. 移动 Web 开发技巧
  5. slide.js使用文档
  6. Emacs 之查看帮助
  7. WPF点补间、拟合回归直线
  8. Asp.net mvc 有关序列化的问题
  9. AWS S3 API实现文件上传下载
  10. jquery事件重复绑定解决办法