はじめに
完全な備忘録です。
事象
M1 Mac で Node のバージョン切り替えコマンド n
を使って、新しいバージョンをインストールしようとすると以下のようなエラーが出る。
n 16.13.0
install : node-v16.13.0
Error: invalid version 16.13.0
n list
で確認すると、16.13.0は存在している。
解決策
ここにIssueが上がっていた。
M1 Mac では、--arch x64
が必要なようだ。
n --arch x64 16.13.0
install : node-v16.13.0
mkdir : /usr/local/n/versions/node/16.13.0
fetch : https://nodejs.org/dist/v16.13.0/node-v16.13.0-darwin-x64.tar.gz
######################################################################### 100.0%
installed : v16.13.0
以上。