🍣
M1 Macの開発環境をセットアップする(node.js,redis)
自分のメモ用です。
Homebrew
sudo mkdir /opt/homebrew
chown ${username} /opt/homebrew
sudo curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
echo "export PATH=/opt/homebrew/bin:$PATH" >> ~/.zshrc
source .zshrc
Nodebrew
brew install nodebrew
vim $(which nodebrew)
以下を修正
sub system_info {
my $arch;
my ($sysname, $machine) = (POSIX::uname)[0, 4];
if ($machine =~ m/x86_64|arm64/) { // arm64を条件に追加
$arch = 'arm64'; // arm64に変更
Node
mkdir -p ~/.nodebrew/src
nodebrew compile v15.5.0
nodebrew use v15.5.0
echo "export PATH=$HOME/.nodebrew/current/bin:$PATH" >> ~/.zshrc
Redis
brew install redis
# 起動
brew services start redis
Discussion