如何在Ubuntu上安装特定版本的Node? [英] How to install a specific version of Node on Ubuntu?

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

问题描述

我想在Ubuntu 12.04上安装NodeJS版本0.8.18.我尝试安装最新版本,然后使用nvm还原到0.8.18,但是当我运行我的代码时,显然安装的软件包和两个版本(最新版本和0.8.18)都存在问题.由于我不知道如何解决该问题,因此我从Node安装中清除了计算机,并考虑直接安装我感兴趣的版本(v0.8.18).

I would like to install NodeJS version 0.8.18 on Ubuntu 12.04. I tried to install the newest version and then reverting to 0.8.18 by using nvm, but when I run my code apparently there is some problem with the packages installed and the two versions (latest and 0.8.18). Since I don't know how to solve that problem, I cleaned the machine from the Node installation and thought about installing directly the version I'm interested in (v0.8.18).

推荐答案

Chris Lea的ppa回购中有0.8.23.

Chris Lea has 0.8.23 in his ppa repo.

此软件包可让您将存储库添加到apt-get :(您也可以手动执行此操作)

This package let you add a repository to apt-get: (You can also do this manually)

sudo apt-get install software-properties-common

添加Chris Lea的存储库:

Add Chris Lea's repository:

sudo apt-add-repository ppa:chris-lea/node.js-legacy

更新apt-get:

sudo apt-get update

安装Node.js:

sudo apt-get install nodejs=0.8.23-1chl1~precise1

如果您仅添加node.js-legacy,我认为(随意编辑)版本号是可选的.如果同时添加了legacy和ppa/chris-lea/node.js,则很可能需要添加该版本.

I think (feel free to edit) the version number is optional if you only add node.js-legacy. If you add both legacy and ppa/chris-lea/node.js you most likely need to add the version.

这篇关于如何在Ubuntu上安装特定版本的Node?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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