'Can't deploy heroku on Mac OS M1

I'm new on Heroku and trying to deploy my project here. After I typed this command in the terminal: curl https://cli-assets.heroku.com/install.sh | sh

and I also typed the administrative password correctly , I got this error message: unsupported arch: arm64



Solution 1:[1]

The script does not support arm64 (see line 40 pf the script).

The easier option is to install via brew

brew tap heroku/brew && brew install heroku

or download the tarball for macOS (if you still prefer doing it manually)

Solution 2:[2]

Try

arch -arm64 brew install heroic

Solution 3:[3]

Download the tarball macOS

tar xvf heroku-darwin-x64.tar
sudo mv heroku /usr/local/lib
cd /usr/local/bin
ln -s  /usr/local/lib/heroku/bin/heroku .
heroku --help

Apple Silicon Issues If you’re getting the following error on a machine with an Apple M1 chip, you haven’t installed or declined to install Rosetta 2. Bad CPU type in executable Installing Rosetta 2 resolves this issue. If you don’t want to install Rosetta 2 on your machine, you can install the Heroku npm package globally and use your own Node binary locally. Only v16 of Node has M1 ARM support and npm isn’t the recommended install method. ref: heroku install

Solution 4:[4]

Try

arch -arm64 brew install heroku

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Beppe C
Solution 2
Solution 3
Solution 4 Huang Yu Ti