yts61
yts61

Reputation: 1599

How to fix error when installing libjpeg in M1 MacBook Pro?

I am installing libjpeg in my arm64 Terminal with the command

brew install libjpeg

But it gives me this error:

Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)!
Please create a new installation in /opt/homebrew using one of the
"Alternative Installs" from:
  https://docs.brew.sh/Installation
You can migrate your previously installed formula list with:
  brew bundle dump

What does it mean? and how to fix it? Thank you guys in advance.

Upvotes: 1

Views: 642

Answers (1)

TeflonMusk
TeflonMusk

Reputation: 150

Run this command in terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

In terminal run this:

touch .zshrc

Open it to edit with TextEdit (It is a hidden file, so shift + command + . will unhide it)

Add this line at the end of .zshrc:

export PATH=/opt/homebrew/bin:$PATH

Run this in terminal to make it available:

source ~/.zshrc

Check to make sure it worked:

brew help

Upvotes: 1

Related Questions