安装 nodejs 4.2.0 或以上版本 [英] Install nodejs 4.2.0 or above version
问题描述
我已经在我的 Ubuntu 机器上使用以下命令安装了 node 和 npm:
<前>sudo apt-get 安装 nodejs npm在检查已安装的版本时,我可以看到以下内容:
<前>$ node -v && npm -vv0.10.251.3.10但我希望 nodejs 版本为 4.2.0 或更高版本.我正在尝试为一个项目安装 VSO Linux 代理.在执行 node agent/vsoagent
时,我收到节点版本应为 4.2.0 或更高版本的错误.
我如何安装它并确保使用 node -v && 删除已经安装的那些npm -v
给我新的版本号?
谢谢
你已经有了 npm,所以你可以使用 n manager 来安装你想要的任何版本(例如 4.4.4):也许你应该使用 sudo 进行全局安装:
npm install -g n4.4.4
或
n 最新
之后,您可以运行 n 来选择您喜欢的版本.我并排使用最新的 LTS 和最新的 6.x 并随时切换它们.
I have installed node and npm using following command in my Ubuntu machine:
sudo apt-get install nodejs npm
On checking version of installed, I could see following:
$ node -v && npm -v v0.10.25 1.3.10
But I want nodejs version to be 4.2.0 or above. I am trying to install VSO Linux agent for a project. On executing node agent/vsoagent
, I get error that node version should be 4.2.0 or above.
How do I install it and also make sure that the already installed ones are removed with node -v && npm -v
gives me new version number?
Thanks
You already have npm, so you can use n manager to install any version you want (4.4.4 for ex): maybe you should use sudo for global install:
npm install -g n
n 4.4.4
Or
n latest
After that you can just run n to select version that you prefer. I use latest LTS and latest 6.x side-by-side and switching them anytime i want.
这篇关于安装 nodejs 4.2.0 或以上版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!