0
0

More than 1 year has passed since last update.

vuejsの学習で環境構築をするために、
node.jsをインストールしようとした時のエラーをまとめます。

環境構築に必要な作業は、
①node.jsをインストール。
(node.jsをインストールするのに、HomebrewとNodebrewをインストールしないといけない)
②VueCLIをインストール。

①のnode.jsのインストールに苦戦したのでまとめます。

発生している問題・エラー

①今回はnode.jsのバーージョン14.6
 をインストールしたいので下記コマンド実行。

$ nodebrew install-binary v14.16.0

次に、インストールされたバージョンを確認

 nodebrew ls

使用するバージョンを指定

nodebrew use v14.16.0

結果

v14.16.0

current: v14.16.0

ここまでは問題なし。
再度に

node -v

で最終確認しようとしたが、

zsh: command not found: node

インストールしたはずなのに、
node.jsを確認できない、、、

・mac再起動。
・node.jsをアンインストール、もう一度インストールしたが
 解決せず、、、

・結論、nodebrewのセットアップをしていないことが原因。

nodebrewのセットアップ

$ nodebrew setup
Fetching nodebrew...
Installed nodebrew in $HOME/.nodebrew

========================================
Export a path to nodebrew:

export PATH=$HOME/.nodebrew/current/bin:$PATH
========================================

PATHを通す

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

再度node.jsインストール

$ nodebrew install-binary v14.16.0

Node.jsを有効にする。

$ nodebrew use stable

再度にバージョン確認

$ node -v

v14.16.0

無事解決できました!

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