Quantcast
Channel: Programming – Gea-Suan Lin's BLOG
Viewing all articles
Browse latest Browse all 103

來試著用 mise

$
0
0

應該是前幾天在 Mastodon 上看到 (但找不到了) 有人提到 mise 這個套件,可以不用每個程式語言都裝各自的 version manager (以 Node.js 這邊的話就像是 nvmfnm 的東西),剛剛先開個獨立的 user 丟進去測,測試的情況還可以接受,就換起來用看看...

官網提供的安裝方式有不少選項可以選,除了 ... | bash 的方法以外,還有自己抓 binary 下來,丟到任何可以跑的目錄下,或是透過 apt 安裝與更新。

有了 mise 後,接著把這段 code 放到每次 login 執行的地方:(PS:裡面 bash 的欄位也可以改成 zsh)

if command -v mise > /dev/null; then
    eval "$(mise activate bash)"
fi

然後重新登入讓他生效,接著就是裝一堆東西,參數可以自己用 --help 看說明:

mise ls
mise use -g go
mise use java@11
mise use java@17
mise use -g java@lts
mise use node@16
mise use node@18
mise use -g node@lts
mise use -g perl
mise use -g python@3.12
mise use -g ruby
mise use -g rust

在裝的時候發現有些是吃 asdf 社群的資源。

另外一個我自己很需要的功能是支援 .nvmrc 切版本的功能,切進目錄後用 node -v 會看到版本切過去了。


Viewing all articles
Browse latest Browse all 103