1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)!

Last updated at Posted at 2021-08-14

エラーの発生状況

  • macのM1チップのPCにおいて、homebrewを使ってインストールしようとしたら、上記タイトルのエラーが発生しました。

具体的なエラー発生の流れ

  • 自分の場合、homebrewでaws-sam-cliをインストールしようとしたら、上記タイトルのエラーが発生しました。
  • 以下のようにmacのターミナルにコマンドを入力しました。
$ brew tap aws/tap

$ brew install aws-sam-cli
Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)!
To rerun under ARM use:
    arch -arm64 brew install ...
To install under x86_64, install Homebrew into /usr/local.

解決方法

arch -arm64 brew install aws-sam-cli
  • 上記、エラー発生時の英語のコメントで書いてある通りにbrewの前に、arch -arm64をつけて実行するだけで解決します。なお、...の部分が不親切な気がします。
  • aws-sam-cliの部分は、自分のインストールしたいパッケージ名に変更して下さい。

参考サイト

追記

  • brew install treeを実行しても同様のエラーが出ました。
    • arch -arm64 brew install treeと入力して、解決しました。
  • 他は確認してませんが、MacのM1チップのPCにおいて、brew install ~を実行すると、基本的にこのエラーが出るということみたいですね。
1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?