amplify-cli: CLI V.8 is not working under M1
Before opening, please confirm:
- I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- I have searched for duplicate or closed issues.
- I have read the guide for submitting bug reports.
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- I have removed any sensitive information from my code snippets and submission.
How did you install the Amplify CLI?
npm install -g @aws-amplify/cli
If applicable, what version of Node.js are you using?
v17.8.0
Amplify CLI Version
What operating system are you using?
macOS
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
Nope
Amplify Categories
Not applicable
Amplify Commands
Not applicable
Describe the bug
When I install the newest cli, the cli is VOID. amplify --v is not return any text. all other amplify commands too.
Expected behavior
… do something.
Reproduction steps
reInstalled macOS today and installed the cli
GraphQL schema(s)
# Put schemas below this line
Log output
# Put your logs below this line
Additional information
No response
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 15
- Comments: 37 (9 by maintainers)
I am also on OSX M1 and just ran into the no output on cli v8 issue while setting up a new machine. Downgrading to v7 worked well. It feels like requiring a rosetta install to work with a newer version of cli is a step backwards. Hoping whatever dependency in v8 that seems to require rosetta can be eliminated or updated to support m1 natively.
hi @josefaidt, after installing
softwareupdate --install-rosetta, amplify-cli v8 works. Thanks.Chip: Apple M1 Pro
v7 seems like working
@kzetxa’s suggestion didn’t work for me, since it still downloads an x86 build, it fails with
Bad CPU type in executable.@wderezin’s suggestion did work for me (many thanks!) with a couple of minor additions to allow the
amplifycommand to work from anywhere. Here’s what worked for me:Now you can run
amplify statusfrom an amplify project and it should work.It’s pretty frustrating that this is still required. I guess AWS expects us to brute-force the issue via Rosetta, but I haven’t needed Rosetta up until now so I’d rather avoid it.
Hey @crzyjcky can you paste the output of running
archand try installing Rosetta withsoftwareupdate --install-rosettato see if this mitigates the issue?@josefaidt here you go,
and when I install using following command then amplify runs as expected.
npm install -g @aws-amplify/cli@7 --forceI’m using node 16.1.0, and I’ve installed node using asdf using following commands,
I’ve also tried with latest version of node directly without asdf but was still getting the same issue.
i installed the v7 and pulled my project, after that, I installed v8
@biller-aivy I’m also facing the same issue that there is no output on executing any amplify cli command, can you share how did you resolve this? Otherwise I feel like I’ll have open a new issue.
Thanks @danrivett and everyone!
Following your suggestions I managed to build the project from source without Rosetta.
I agree with @thtliife: using Rosetta doesn’t seem the right way to go.
I had to fix one thing, though, because I got some errors when invoking
yarn.I am using Node.js v19.2.0.
After checking out the desired version (
git checkout v12.0.3in my case), I had to add the following to theresolutionssection ofpackage.json:to force the usage of the version of the nan package (https://github.com/nodejs/nan/) in which the maintainers just fixed a bug.
The nan package is not directly required in the root
package.json, but it’s required throughout the setup process.After applying this modification, the installation and building of the project went smoothly for me.
If you link the command (
ln -s...) as @danrivett suggests, you may need to add~/.amplify/binto yourPATH:To make the addition permanent, add the command to your shell profile file (ie
.zshrcor.bash_profileetc.).Hope this helps!
Thanks @wderezin and @danrivett Building from source on my m1 machine without Rosetta installed sorted this out for me. I am trying to keep my macbook running m1 native apps only, as i believe emulating apps to be a bit of a step backwards. The information you guys provided was very valuable in keeping my system running native binaries only 😃
Here is the workaround I used to get cli v9 working on Mac arm64 with Rosetta. Build from source. The Max node supported version is v16.
You get a working amplify.
The M1, arm64, is not supported.
After several different installs attempts, the amplify binary every time it generates x86.
If you look at at the supported platform in the binary.ts you can see the Mac arm64 package is pointed to the x64 version.
downgrading to 7.6.26 fixed the issue for me as well.
I was able to get it working by downloading
amplify-pkg-macos.tgzfile from releases.I deleted the binary at
/usr/local/bin/amplify, renamed the binary inside the package that I downloaded, and moved it to the location where the old deleted binary was. I noticed that I also needed to dosudo chown -R $(whoami) ~/.amplify. It seems after running amplify, I have another binary in my~/.amplifydirectory.Not sure why installing it via NPM was not working. I had no errors, just a dead binary with no output.
I am running on a 2021 Macbook Pro 16" M1 Max, with Node 16.12.0, Amplify 10.3.1, and macOS Monterey 12.6.