LoginSignup
7
6

More than 3 years have passed since last update.

M1 Macでasdfを使ってnodejsをインストールしたい (2021/02/22時点)

Last updated at Posted at 2021-02-22

M1 Macでasdfを使ってnodejsを動かそうとしたら微妙にハマったメモ。

asdfでnodejsをインストールしようとすると

$ asdf install nodejs xx.xx.xx

Binary not found for version xx.xx.xx

のようなエラーが出る人向け。

結論

この記事を書いている2021/02/22時点では、M1 Macに対してnodejsの arm64 バイナリが提供されていない。 このため、シェルが arm64 で実行されている場合、 arm64 のバイナリを取得しようとして失敗する。asdfを x86_64 で実行することで、 x86_64 のバイナリを取得できる。

nodejsのインストール時にarchコマンドでアーキテクチャを指定する。

$ arch -x86_64 asdf install nodejs xx.xx.xx

参考: https://github.com/asdf-vm/asdf-nodejs/issues/189#issuecomment-757048599

7
6
0

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