furuhashilab / Tochizi-hai-OpenDataHackathon

都知事杯 オープンデータハッカソンのリポジトリ
https://furuhashilab.github.io/Tochizi-hai-OpenDataHackathon/
1 stars 0 forks source link

Node.jsのセットアップ方法(Mac) #5

Open Ayako-T opened 2 years ago

Ayako-T commented 2 years ago

Node.jsをMacOSにインストールする

Ayako-T commented 2 years ago

homebrewを使ってインストールをする このサイトを参考にする https://qiita.com/kyosuke5_20/items/c5f68fc9d89b84c0df09

Ayako-T commented 2 years ago

nodebrew install-binary stableのコマンドを実行するとエラーが出てしまった image

Ayako-T commented 2 years ago

以下のコマンドを実行して、nodebrew用のディレクトリを作った mkdir -p ~/.nodebrew/src

image

Ayako-T commented 2 years ago

インストールすることができた image

Ayako-T commented 2 years ago

インストールされたnode を有効化する nodebrew lsで ”current: none"であることを確認し、必要なバーションを有効化する image

Ayako-T commented 2 years ago

環境パスを通す 以下のコマンドを実行し、ターミナルを再起動する echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.zprofile

Ayako-T commented 2 years ago

nodeが使えるかを下記のコマンドで確認する

node -v 先程有効化したバージョンが表示されたので、完了 image