Skip to content

如何在 Ubuntu 20.04 上安裝 nvm

Last updated on 2021 年 8 月 11 日

NVM 是一個 Node.js 的版本管理器工具。 他可以讓我們在單個系統上安裝多個 Node.js 版本。因為工作關係,需要用到,所以來紀錄一下,如何在 Linux Ubuntu 20.04 系統上去安裝 NVM。

在 Ubuntu 上安裝 NVM


我們必須先在系統上安裝 curl,才可以去跑 NVM 的安裝程式。

sudo apt install curl 
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile    

使用 NVM 安裝節點


接著我們就可以使用 NVM來去安裝多個 node.js 版本了。

假設我們要直接安裝最新版本的 node.js:

nvm install node 

當然了,你也可以直接指定版本

nvm install 12.18.3  

至於其他用法,可以直接參考 GitHub 上的文件喔

https://github.com/nvm-sh/nvm

Published in筆記

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

error: 尊重智慧財產權,請不要隨意複製使用文章喔