在 Ubuntu Zesty 17.04 上安装 Node 6.9 [英] Install Node 6.9 on Ubuntu Zesty 17.04
本文介绍了在 Ubuntu Zesty 17.04 上安装 Node 6.9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在 Ubuntu Zesty 17.04
上安装最新版本的 NodeJS
.但是无论是使用 apt-get 还是尝试从 nodesource ppa 下载它,我总是使用 4.7.2 版本.
I want to install a newest version of NodeJS
on Ubuntu Zesty 17.04
. But whether using apt-get or trying to download it from nodesource ppa, I always have the version 4.7.2.
apt-get
sudo apt-get update
sudo apt-get install nodejs npm
节点PPA
curl -sL https://deb.nodesource.com/setup_6.x | sudo bash -
sudo apt-get update
apt-get install nodejs npm
结果
$> node -v
v4.7.2
如何获取 NodeJS 6.9 版本?
How can I get the version 6.9 of NodeJS ?
推荐答案
我没有成功通过 apt-get 或 nodesource ppa 安装它.但是我按照以下步骤手动安装 Node 解决了这个问题:
I didn't succeed to install it via apt-get or nodesource ppa. However I solved the problem by installing Node manually by following these steps :
- 删除旧版本
sudo apt-get remove --purge node
- 从 https://nodejs.org/en/ 下载 Node 二进制文件
- 将存档解压缩到您想要的位置
tar -xzf
.tar.gz -C - 创建节点符号链接
ln -sf
/bin/node/usr/bin/node - 创建nodejs符号链接
ln -sf
/bin/node/usr/bin/nodejs
- Remove the old version
sudo apt-get remove --purge node
- Download Node binaries from https://nodejs.org/en/
- Extract the archive where you want
tar -xzf <ARCHIVE>.tar.gz -C <YOUR_FOLDER>
- Create a node symbolic link
ln -sf <YOUR_FOLDER>/bin/node /usr/bin/node
- Create a nodejs symbolic link
ln -sf <YOUR_FOLDER>/bin/node /usr/bin/nodejs
结果:
radouane@roufid:$ node -v
v6.10.2
希望能帮到你!
这篇关于在 Ubuntu Zesty 17.04 上安装 Node 6.9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文