ページを読み込んでいます
asdf 版本管理器必備指令速查表
在搜尋欄位輸入指令名稱,或依類別(外掛管理、版本管理等)篩選,找到所需的指令。
查看指令說明、常用選項及實際使用範例。
點擊複製按鈕將指令複製到剪貼簿,即可在終端機中直接使用。
asdf plugin add nodejs新增 Node.js 外掛asdf plugin add python新增 Python 外掛asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git從自訂 URL 新增外掛asdf plugin list顯示已安裝的外掛asdf plugin list --urls顯示外掛及其 URLasdf plugin list all顯示所有可用的外掛asdf plugin remove nodejs移除 Node.js 外掛asdf plugin remove python移除 Python 外掛asdf plugin update nodejs更新 Node.js 外掛asdf plugin update python更新 Python 外掛asdf plugin update --all一次更新所有外掛asdf install nodejs 20.11.0安裝 Node.js 20.11.0asdf install nodejs latest安裝最新穩定版 Node.jsasdf install安裝 .tool-versions 中的所有版本asdf uninstall nodejs 18.0.0解除安裝 Node.js 18.0.0asdf uninstall python 3.9.0解除安裝 Python 3.9.0asdf list nodejs顯示已安裝的 Node.js 版本asdf list顯示所有已安裝的版本asdf list all nodejs顯示所有可用的 Node.js 版本asdf list all nodejs 20僅顯示 Node.js 20.x 版本asdf latest nodejs顯示最新穩定版 Node.jsasdf latest python顯示最新穩定版 Pythonasdf current顯示所有目前版本asdf current nodejs顯示目前的 Node.js 版本asdf global nodejs 20.11.0設定全域 Node.js 版本asdf global python latest將 Python 全域設定為最新版本asdf global nodejs system使用系統的 Node.js 版本asdf reshim nodejs重新產生 Node.js shimasdf reshim python 3.12.0重新產生 Python 3.12.0 的 shimasdf local nodejs 20.11.0設定本地 Node.js 版本asdf local python 3.12.0設定本地 Python 版本asdf local ruby latest將 Ruby 本地設定為最新版本asdf shell nodejs 18.0.0在此 shell 工作階段使用 Node.js 18.0.0asdf shell python 3.11.0在此 shell 工作階段使用 Python 3.11.0asdf shell nodejs --unset取消 shell 版本設定asdf where nodejs 20.11.0顯示 Node.js 20.11.0 的安裝路徑asdf where python顯示目前 Python 的安裝路徑asdf which node顯示 node 執行檔的路徑asdf which python顯示 python 執行檔的路徑asdf info顯示 asdf 環境資訊asdf update將 asdf 更新至最新穩定版asdf update --head將 asdf 更新至最新開發版asdf help顯示一般說明asdf help install顯示 install 指令的說明asdf 指令一覽是彙整 asdf 版本管理器必備指令的速查表。從外掛管理到版本控制、全域/本地設定,全面涵蓋建置開發環境所需的指令。每個指令都包含說明、常用選項及可一鍵複製的實用範例。
asdf global 會寫入 ~/.tool-versions,設定所有目錄通用的預設版本。asdf local 會寫入目前目錄的 .tool-versions,設定僅在該專案內有效的版本。
asdf shell 設定僅在目前 shell 工作階段有效的臨時版本。當您需要暫時使用不同版本進行測試或驗證時很方便。關閉 shell 後設定就會恢復。
asdf 使用 shim 將指令路由到正確的版本。透過 npm install -g 等安裝全域套件後,需要執行 reshim 讓系統識別新的執行檔。
.tool-versions 是定義專案使用的執行環境版本的檔案。將此檔案提交到版本庫,可確保團隊成員都使用相同版本。執行 asdf install 即可一次安裝檔案中列出的所有版本。
asdf where 傳回版本的安裝目錄(例如:~/.asdf/installs/nodejs/20.11.0)。asdf which 傳回執行檔的具體路徑(例如:~/.asdf/installs/nodejs/20.11.0/bin/node)。