LoginSignup
11
7

More than 1 year has passed since last update.

M1 mac にて nodebrew をインストールしようとしたら詰まった話

Last updated at Posted at 2022-03-24

はじめに

M1 macにて nodebrew をinstallしようとしたら普通に詰まって大変だった(半泣き)

フロントエンドエンジニアには欠かせないNode.js

フロントエンドエンジニアを目指して日々勉強している身としては環境構築で戸惑ってしまうのは非常にロスだ。
こんなことが二度と起きないために書き記しておく。

Homebrewのインストール

% cd /opt
% sudo mkdir homebrew
% sudo chown $USER homebrew
% curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew

# PATHを通す
% cd
% vim .zshrc

export PATH=/opt/homebrew/bin:/usr/local/bin:$PATH

% source .zshrc
% which brew
/opt/homebrew/bin/brew

# Xcodeのライセンスにagree
% sudo xcodebuild -license accept

sudo softwareupdate --install-rosetta

参考サイト


nodebrewのインストール

curl -L git.io/nodebrew | perl - setup

brew install -s nodebrew

参考サイト


Node.jsのインストール

nodebrew compile v15.4.0

参考サイト


おまけ(nodebrewのコマンド集)

インストール済みのバージョンを調べる

nodebrew ls

インストールできるバージョンを調べる

nodebrew ls-remote

インストールする

nodebrew install <version>

使用するバージョンを切り替える

nodebrew use <version>

参考サイト
Macでnodeのバージョン切り替え -nodebrew の使い方- - Qiita

追記

もう nodebrew は使っておりません・・・
なぜならVoltaの方が優秀でしたので🔥

11
7
1

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
11
7