2
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?

More than 5 years have passed since last update.

node: No such file or directory エラーが出る

Posted at

browser-syncを実行しようとしたところ、エラーが出たので備忘録です。

cmd

こんな感じ。
nodeコマンドがないと言われている。
確認していきます。

nvmコマンド打てるか

ないと言われる場合はまず、~/.nvm ディレクトリあるか確認
その後,bashrc ,zshrc等にnvmのスクリプトが記載されているか。

cmd

こんな感じ。
記載されていない場合,自分で書くか、macの場合は

$ brew info nvm

とかやると、どう設定すべきかでてくる。

nodeの確認

nvmに何がインストールされているのか確認。

$ nvm ls

インストールされていなかった場合はnvm instal
インストールされている場合はnvm use

これでnodeと打ち、使えることを確認。

defaultの設定

ログイン時にも保持してくれるように defaultを下記で設定

$ nvm alias default [バージョン]

この後再度ログインしてnodeが実行できたら完了!!(^O^)

2
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
2
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?