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

查看:39
本文介绍了如何在 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:

Install 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天全站免登陆