简体   繁体   English

Node与Nodejs版本不同

[英]Node vs Nodejs versions are different

I am starting to learn Nodejs and tried to install it. 我开始学习Nodejs并尝试安装它。

Now, when I do node -v I get v4.4.4 and when I do nodejs -v , I get v0.10.45 现在,当我执行node -v我得到v4.4.4 ;当我执行nodejs -v ,我得到v0.10.45

which node gives /usr/local/bin/node , which nodejs gives /usr/bin/nodejs which node给出/usr/local/bin/nodewhich nodejs给出/usr/bin/nodejs

I need v4.4.4 . 我需要v4.4.4 Because of those different results I am not sure to start. 由于结果不同,我不确定要开始。

What can I do? 我能做什么?

I recommend installing NVM (node version manager). 我建议安装NVM (节点版本管理器)。 It makes dealing with multiple node version installations really nice. 这使得处理多个节点版本的安装非常好。 Digital Ocean has a good tutorial on doing that here: Digital Ocean在此处提供了有关此操作的很好的教程:

https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-an-ubuntu-14-04-server https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-an-ubuntu-14-04-server

Once you've installed NVM you can likely remove your other node versions and all of your programs that use node will default to whatever version you set as the default with nvm. 安装NVM后,您可能会删除其他节点版本,并且所有使用该节点的程序都将默认使用nvm设置为默认版本的任何版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM