在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.
获取
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 <ARCHIVE>.tar.gz -C <YOUR_FOLDER>
- 创建节点符号链接
ln -sf <YOUR_FOLDER>/bin/node /usr/bin/node
- 创建 nodejs 符号链接
ln -sf <YOUR_FOLDER>/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屋!
查看全文