amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

CLI V.8 is not working under M1

Open biller-aivy opened this issue 3 years ago • 37 comments

Before opening, please confirm:

  • [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • [X] I have searched for duplicate or closed issues.
  • [X] I have read the guide for submitting bug reports.
  • [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • [X] 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

@newest

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

biller-aivy avatar Apr 12 '22 09:04 biller-aivy

Hey @biller-aivy :wave: thanks for raising this! Unfortunately I am not able to reproduce on my M1 mac using Node versions 14, 16, and 17. How was Node and npm installed?

josefaidt avatar Apr 12 '22 12:04 josefaidt

@josefaidt after I pulled my amplify app, and updated it to v8 it is working. Installed over Homebrew

biller-aivy avatar Apr 12 '22 12:04 biller-aivy

Thanks for clarifying @biller-aivy ! To clarify, is this working now? What sort of issues were you seeing prior to fixing the issue?

josefaidt avatar Apr 12 '22 13:04 josefaidt

@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.

saif003 avatar Apr 12 '22 15:04 saif003

i installed the v7 and pulled my project, after that, I installed v8

biller-aivy avatar Apr 12 '22 15:04 biller-aivy

i installed the v7 and pulled my project, after that, I installed v8

downgrading to 7.6.26 fixed the issue for me as well.

saif003 avatar Apr 12 '22 16:04 saif003

Hey @saif003 and @biller-aivy would y'all mind sharing a screenshot of the install and first command execution? Unfortunately I have not been able to reproduce this issue on my end using an M1 mac

josefaidt avatar Apr 15 '22 19:04 josefaidt

@josefaidt here you go, Screenshot 2022-04-16 at 2 29 30 PM

and when I install using following command then amplify runs as expected.

npm install -g @aws-amplify/cli@7 --force

Screenshot 2022-04-16 at 2 32 50 PM

I'm using node 16.1.0, and I've installed node using asdf using following commands,

asdf plugin add nodejs
asdf install nodejs 16.1.0
asdf global nodejs 16.1.0

I've also tried with latest version of node directly without asdf but was still getting the same issue.

saif003 avatar Apr 16 '22 09:04 saif003

Hey @saif003 thank you for those screenshots, and while I initially tested on Node 16.14.1/2 I downgraded to 16.1.0 to no avail image

Can you post a snippet from your logs at ~/.amplify/logs at the time this occurs?

josefaidt avatar Apr 22 '22 14:04 josefaidt

Hey @biller-aivy :wave: just wanted to follow-up on my previous message and see if you are able to capture logs at the time this occurs?

josefaidt avatar Apr 29 '22 20:04 josefaidt

Starting with Amplify v8 on OSX (M1), using the amplify upgrade command seems to be the culprit. After the upgrade, any amplify command, even "amplify -v" produces no output. I have to completely remove the package "npm remove .." and then "npm install ..." to restore normal operations.

bc4253 avatar May 03 '22 17:05 bc4253

Hey @bc4253 did you install the CLI initially using sudo by chance? After executing amplify upgrade the first command does take an excessive amount of time to respond but it should print something

josefaidt avatar May 04 '22 20:05 josefaidt

Hey @biller-aivy and @bc4253 just wanted to follow-up here and see if you are still experiencing this issue?

josefaidt avatar May 13 '22 19:05 josefaidt

Chip: Apple M1 Pro

% node -v
v18.2.0

% npm -v
8.9.0

% curl -sL https://aws-amplify.github.io/amplify-cli/install | bash && $SHELL
...
bash: line 111: /Users/<home folder>/.amplify/bin/amplify: Bad CPU type in executable

% npm i -g @aws-amplify/cli
added 26 packages, and audited 27 packages in 36s

% amplify # return nothing
% which amplify
/Users/<home folder>/.amplify/bin/amplify

 % /Users/<home folder>/.amplify/bin/amplify
zsh: bad CPU type in executable: /Users/<home folder>/.amplify/bin/amplify

v7 seems like working

% npm install -g @aws-amplify/cli@7 --force
% amplify -v
7.6.26

crzyjcky avatar May 19 '22 15:05 crzyjcky

Hey @crzyjcky can you paste the output of running arch and try installing Rosetta with softwareupdate --install-rosetta to see if this mitigates the issue?

josefaidt avatar May 19 '22 20:05 josefaidt

hi @josefaidt, after installing softwareupdate --install-rosetta, amplify-cli v8 works. Thanks.

% arch
arm64

% amplify -version
8.2.0

crzyjcky avatar May 20 '22 04:05 crzyjcky

Hey @crzyjcky I'm glad to hear that worked well! I'll mark this as a documentation issue to add this callout to our installation docs!

josefaidt avatar May 23 '22 18:05 josefaidt

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.

metsaiga09 avatar May 24 '22 03:05 metsaiga09

I am still having issues. I originally installed some v8 version a few weeks back and all was fine until there was an upgrade. After running amplify upgrade, then amplify always return no cli output of any kind. However if I run "sudo amplify --version" or any other amplify command, it works fine. I just ran the upgrade to v8.3.0 and still have the same issue. I have not recently tried to uninstall and reinstall. last time I tried the uninstall/reinstall that did not fix my problem. I had just finished following the procedure to add a .npm-global directory, maybe that is the cause of why a fresh install doesnt work either?

bc4253 avatar May 24 '22 05:05 bc4253

@bc4253 - did you try the step in this message above: https://github.com/aws-amplify/amplify-cli/issues/10193#issuecomment-1132433956 ? Does that fix for you?

InnovateWithEric avatar May 25 '22 19:05 InnovateWithEric

@bc4253 - did you try the step in this message above: #10193 (comment) ? Does that fix for you?

It does not, I already have rosetta installed. the arch command returns arm64

bc4253 avatar Jun 14 '22 13:06 bc4253

Same problem found on NixOS 22.05, had to downgrade to make it work !

Tchekda avatar Jul 12 '22 11:07 Tchekda

I'm on M1, installing Rosetta worked for me. Thank you @josefaidt

dlamon1 avatar Jul 14 '22 16:07 dlamon1

The M1, arm64, is not supported.

After several different installs attempts, the amplify binary every time it generates x86.

# file  ~/.amplify/bin/amplify
~/.amplify/bin/amplify: Mach-O 64-bit executable x86_64

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.

  {
    TYPE: 'Darwin',
    ARCHITECTURE: 'arm64',
    COMPRESSED_BINARY_PATH: 'amplify-pkg-macos-x64.tgz',
  },

wderezin avatar Jul 26 '22 12:07 wderezin

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.

git clone https://github.com/aws-amplify/amplify-cli.git
cd amplify-cli
nvm use 16
yarn install
yarn run build

You get a working amplify.

# ./node_modules/.bin/amplify --version
9.1.0

wderezin avatar Jul 26 '22 13:07 wderezin

Hey @bc4253 did you install the CLI initially using sudo by chance? After executing amplify upgrade the first command does take an excessive amount of time to respond but it should print something

Amplify CLI 10.0.0, Node 16.14.0, M1 Mac I ran sudo amplify upgrade If I run sudo before status, --help, --version, etc. it works. Id' like for this not to be the case, should I open a new issue?

mkirby42 avatar Sep 22 '22 14:09 mkirby42

hi @josefaidt, after installing softwareupdate --install-rosetta, amplify-cli v8 works. Thanks.

% arch
arm64

% amplify -version
8.2.0

This worked for me as well on M2 chip

VedanthB avatar Sep 28 '22 09:09 VedanthB

hi @josefaidt, after installing softwareupdate --install-rosetta, amplify-cli v8 works. Thanks.

% arch
arm64

% amplify -version
8.2.0

This does not work for me on an M1 MacBook Air. The only solution is to download v7, however then my configure command hangs. I have seen a few past issue reports of this, but they were all on Windows.

% amplify -v
7.6.26

% amplify configure
? Select the backend providers. (Press <space> to select, <a> to toggle all, <i> to invert selection)

No other output or backend providers shown.

omidmogasemi avatar Oct 01 '22 19:10 omidmogasemi

I did install with “sudo npm install -g @aws-amplify/cli” and then upgraded with “sudo amplify upgrade”. After the upgrade finishes, then any amplify command, even just “amplify -v”, immediately returns and produces no output.

My environment is Apple silicon MacBook Pro.

Brian Chojnowski Senior Consultant AT&T Consulting

AT&T Integrated Solutions & Consulting 930 National Parkway, Schaumburg, IL 60173 m 630.484.6422 o 630.484.6422 | @.@.>

From: josef @.> Sent: Wednesday, May 4, 2022 3:55 PM To: aws-amplify/amplify-cli @.> Cc: CHOJNOWSKI, BRIAN @.>; Mention @.> Subject: Re: [aws-amplify/amplify-cli] CLI V.8 is not working under M1 (Issue #10193)

Hey @bc4253https://urldefense.com/v3/__https:/github.com/bc4253__;!!BhdT!mohOrNGpfj9HknqM_Z2stFbHoHb-4hS6s6-DI1WMMMbkOXtdLcSsfq516iJ8DAk_1tv6-q_xNkDu7KxSUs-_wok$ did you install the CLI initially using sudo by chance? After executing amplify upgrade the first command does take an excessive amount of time to respond but it should print something

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/aws-amplify/amplify-cli/issues/10193*issuecomment-1117929809__;Iw!!BhdT!mohOrNGpfj9HknqM_Z2stFbHoHb-4hS6s6-DI1WMMMbkOXtdLcSsfq516iJ8DAk_1tv6-q_xNkDu7KxSnWgY-6A$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/APG3K5YSIPVQUZSN7O2CT3DVILPYXANCNFSM5TGAC6NA__;!!BhdT!mohOrNGpfj9HknqM_Z2stFbHoHb-4hS6s6-DI1WMMMbkOXtdLcSsfq516iJ8DAk_1tv6-q_xNkDu7KxSyXbQuG0$. You are receiving this because you were mentioned.Message ID: @.@.>>

bc4253 avatar Oct 11 '22 08:10 bc4253

I was able to get it working by downloading amplify-pkg-macos.tgz file 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 do sudo chown -R $(whoami) ~/.amplify. It seems after running amplify, I have another binary in my ~/.amplify directory.

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.

kzetxa avatar Oct 26 '22 02:10 kzetxa