简体   繁体   English

使用终端 Linux Ubuntu 更改节点版本

[英]Change the version of node with the terminal Linux Ubuntu

I have problem with nodejs I tried to get a new version but didn't work.我在使用 nodejs 时遇到问题,我尝试获取新版本但没有成功。 I deleted the old version 12.** after that I installed the new one 19.x.我在安装新版本 19.x 之后删除了旧版本 12.**。 when I tap node -v it giving me this当我点击 node -v 它给了我这个

1个

What can I do?我能做什么?

I search for the storage capacity thinking that was the problem but it isn't !我搜索存储容量,认为这是问题所在,但事实并非如此!

You can use NVM for installing and switching node version on Ubuntu.您可以使用NVM在 Ubuntu 上安装和切换节点版本。

First NVM command line tool.第一个 NVM 命令行工具。

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash

Then然后

For installing new node version.用于安装新节点版本。

nvm install 14

For switching node version.用于切换节点版本。

nvm use 14

Done:)完毕:)

node -v
v14.18.0

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

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