M1 Macで Create React App の環境構築をしました。
M1 Macの仕様でかなり苦戦しました、、
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を通す
# PATHを通す
% cd
% vim .zshrc
export PATH=/opt/homebrew/bin:/usr/local/bin:$PATH
% source .zshrc
% which brew
/opt/homebrew/bin/brew
Xcodeのライセンス
% sudo xcodebuild -license accept
sudo softwareupdate --install-rosetta
Homebrewとnodebrewのインストール
brew -v
brew install nodebrew
nodebrew -v
Nodeのインストール
% nodebrew ls-remote
% nodebrew setup
% nodebrew install-binary stable
% nodebrew ls
% nodebrew use
Nodeの環境パスを通す
echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.bash_profile
# または
echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.zprofile
完了!
作業環境によるので大変でした。