0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

nvmでmacローカルのnodeのバージョンを管理する

Last updated at Posted at 2025-01-14

nvmインストール確認

  1. nvmが入っていることを確認 nvm --version
  2. 入っていなければ brew install nvm

nvm設定記述

  1. vi ~/.zshrc
    # NVM の設定
    export NVM_DIR="$HOME/.nvm"
    [ -s "$(brew --prefix)/opt/nvm/nvm.sh" ] && \. "$(brew --prefix)/opt/nvm/nvm.sh"  # これがnvmをロード
    [ -s "$(brew --prefix)/opt/nvm/etc/bash_completion.d/nvm" ] && \. "$(brew --prefix)/opt/nvm/etc/bash_completion.d/nvm"  # これがnvmの補完をロード
    
  2. source ~/.zshrc

バージョン切り替え

  1. node -v
  2. インストール済みバージョン一覧確認 nvm ls
  3. インストール nvm install 20.18.1
  4. 最新安定版インストール nvm install stable --latest-npm
  5. 切り替え nvm alias default v*.*.* を実行してターミナル再起動
    • nvm alias default v20.18.1
    • nvm alias default v23.6.0
  6. node -v
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?