hello foo bar
node.jsが突如消えるときがあります。実際は消えているわけではなくて、選択できなくなっているということになってます。
以下のコマンドでnode.jsのバージョンを確認すると、一覧がきちんと出てくるはずです。
$ nodebrew ls-remote
useすればもう一度使えるようになります。
$ nodebrew ls-remote
$ nodebrew install-binary latest
$ nodebrew use v11.12.0
$ nodebrew list
$ echo 'export PATH=$PATH:/Users/xxxxx/.nodebrew/current/bin' >> ~/.bashrc
$ vi ~/.bashrc
$ source ~/.bashrc
$ node -v
しかしこれだと使いづらい。
.bashrcに書き込んでいるパスがテンポラリーになるらしいので、.bash_profileに直接書き込んで保存します。
export PATH=$PATH:/Users/xxxxx/.nodebrew/current/bin
これをviか何かで直接設定します。
https://programming-jissen.com/way-when-node-command-cannot-be-used/