共计 373 个字符,预计需要 1 分钟阅读。
APT安装
对于Ubuntu或者CentOS系统,通过系统apt安装是最为快捷的方法。但需要注意,此方法安装所得的nodejs版本较低,但一般不影响使用。
以下以Ubuntu系统为例
首先,先更新一下系统apt
sudo apt update

接着使用如下命令安装nodejs
sudo apt install nodejs npm

验证安装,检查版本
node -v
输出版本为12.22.9,已经属于较老的版本了
NodeSource安装
那如果要使用更新或是最新的版本如何安装呢?我们可以借助NodeSource网站提供的Deb预编译包直接安装。
访问如下链接,点击Copy按钮后直接在终端中执行即可。

若要安装其余的版本,只需更改NODE_MAJOR
变量的值即可。
安装后我们依然可以来验证一下版本。

可见已经为最新版本。
正文完
I am not sure where youre getting your info but good topic I needs to spend some time learning much more or understanding more Thanks for magnificent info I was looking for this information for my mission