網頁

2023/10/22

Linux 安裝 nvm

Linux安裝nvm的過程如下。


安裝環境:

  • Rocky Linux 9


安裝

在命令列輸入$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash安裝nvm。

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 15916  100 15916    0     0  53409      0 --:--:-- --:--:-- --:--:-- 53589
=> Downloading nvm as script to '/root/.nvm'

=> Appending nvm source string to /root/.bashrc
=> Appending bash_completion source string to /root/.bashrc
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

若安裝後輸入nvm --version檢視版本卻出現-bash: nvm: command not found,則輸入source ~/.bashrc或重新開啟terminal或重新登入Linux server即可。

$ nvm --version
0.39.5


沒有留言:

張貼留言