3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Volta】zsh: command not found: nodeの解決方法

Last updated at Posted at 2025-01-10

はじめに

Voltaを使用してnodeを再インストールした際に、想定外のエラーが発生しました。本記事ではその解決方法を共有します。

この記事は個人的なアウトプットを目的として作成したものです。そのため、誤った情報や不足している内容が含まれている可能性があります。もし間違いや気になる点がございましたら、ぜひご指摘いただけますと幸いです

問題

Voltanodeをインストールした後、nodeのバージョンを確認しようとしたところ、以下のエラーが出力されました。

node -v
zsh: command not found: node

このエラーは、nodeがインストールされていないか、正しく認識されていない場合に発生します。

解決方法

ターミナルに以下のコマンドを入力して、Voltaのパスを環境変数に追加します。

export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"

再度nodeが正しくインストールされているか確認します。

node -v
v22.13.0

これでエラーは解消され、nodeが正しく動作するようになりました。

終わりに

環境構築時にはパス設定が重要であると再認識しました。今後もエラーに直面した際には丁寧に原因を調査し、解決策を学んでいきます。

参考

『あれ? Voltaを使ってるんだけど「node」にPATHが通ってないぞ?』 Qiita

『Node.jsのバージョン管理にVoltaを推したい』 Zenn

3
1
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
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?