# Ubuntu に nodebrew をインストールする方法

Node.js のバージョン管理を簡単に行える nodebrew の Ubuntu へのインストール方法を解説します。

環境

  • ubuntu 24

# nodebrew のインストール

curl -L git.io/nodebrew | perl - setup

# パスの通す

bash の場合

echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

zsh の場合

echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.zshrc
source ~/.zshrc

# インストールの確認

nodebrew -v

# 利用可能な Node.js バージョンの確認

nodebrew ls-remote

# Node.js のインストール

# 最新LTSの安定版をインストール
nodebrew install-binary stable

# v25をインストール
nodebrew install v25

インストール済みバージョンの確認

nodebrew list

特定バージョンの使用

nodebrew use <version>

# v25を使用
nodebrew use v25

システム全体のデフォルト設定

nodebrew alias default <version>

# パーミッションエラーが発生する場合

nodebrew ディレクトリの権限を変更:

chmod -R 755 ~/.nodebrew

これで Ubuntu での nodebrew のインストールが完了

2025-12-09

同じタグを持つ記事をピックアップしました。