Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation fails on M1 MacBook: The chromium binary is not available for arm64 #166

Closed
mrpocketsgb opened this issue Jan 5, 2021 · 16 comments

Comments

@mrpocketsgb
Copy link

Running the installation fails with the following error:

sudo npm install -g aws-azure-login --unsafe-perm
Password:
npm WARN deprecated cheerio-select-tmp@0.1.1: Use cheerio-select instead
npm ERR! code 1
npm ERR! path /opt/homebrew/lib/node_modules/aws-azure-login/node_modules/puppeteer
npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! The chromium binary is not available for arm64:
npm ERR! If you are on Ubuntu, you can install with:
npm ERR!
npm ERR! apt-get install chromium-browser
npm ERR!
npm ERR! /opt/homebrew/lib/node_modules/aws-azure-login/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:112
npm ERR! throw new Error();
npm ERR! ^
npm ERR!
npm ERR! Error
npm ERR! at /opt/homebrew/lib/node_modules/aws-azure-login/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:112:19
npm ERR! at FSReqCallback.oncomplete (node:fs:199:21)

@wellingk
Copy link

wellingk commented Jan 6, 2021

I second this issue. Are there any plans to update this project?

@kennethaasan
Copy link
Collaborator

puppeteer issue: puppeteer/puppeteer#6622

Maybe you can use the docker image until that's fixed?

@markdavidburke
Copy link

puppeteer issue: puppeteer/puppeteer#6622

Maybe you can use the docker image until that's fixed?

I've tried that, sadly it doesn't work yet..

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Logging in with profile 'default'...
Using AWS SAML endpoint https://signin.aws.amazon.com/saml
Error: Protocol error (Target.setDiscoverTargets): Target closed.
    at /aws-azure-login/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:71:63
    at new Promise (<anonymous>)
    at Connection.send (/aws-azure-login/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:70:16)
    at Function.create (/aws-azure-login/node_modules/puppeteer/lib/cjs/puppeteer/common/Browser.js:95:26)
    at ChromeLauncher.launch (/aws-azure-login/node_modules/puppeteer/lib/cjs/puppeteer/node/Launcher.js:99:56)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Object._performLoginAsync (/aws-azure-login/lib/login.js:461:23)
    at async Object.loginAsync (/aws-azure-login/lib/login.js:324:30)

@micmel5997
Copy link

Same here, installation fails on m1 chip macbook.

@gubbaraviteja
Copy link

Facing the same issue as @markdavidburke while using the docker image. We really loved it from the day we found it and we're using this every day. It would be really nice to get this working on Mac m1 chip.

@mcfearsome
Copy link

Ok so I got this to work by having a separate x86 version of terminal (first duplicate the App then right click -> Get Info -> check "Open using Rosetta"). Then I have a 2nd copy of Brew install pointing at /usr/local which I have aliased to run with arch -x86_64 and as x86brew. With this I then installed node with x86brew install node. I also had to make sure /usr/local/bin was first in path as I had node installed with my native copy of brew and it kept picking up the wrong one.

Hope this helps

@gubbaraviteja
Copy link

I've made it to work on M1 by doing these steps.

export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
export PUPPETEER_EXECUTABLE_PATH=`which chromium`

I've taken the aws-azure-login fork and ran npm install and updated code following the below comments from puppeteer issues.
puppeteer/puppeteer#6622 (comment)
puppeteer/puppeteer#6641 (comment)

Now I can run aws-azure-login in my machine. Hope this helps someone facing issues reg aws-azure-login on M1 :)

@kennethaasan
Copy link
Collaborator

kennethaasan commented Apr 8, 2021

This might have been fixed in #180 because I updated puppeteer.
Released as aws-azure-login@3.3.0

Please close the issue if so.

@gubbaraviteja
Copy link

I've taken the latest image but still getting the same error.
Screenshot 2021-04-11 at 06 17 08

@e-hulten
Copy link

The issue persists for me as well with the same puppeteer/chromium related error message.

However, the following worked for me to finally get it installed and running on an M1 MacBook Pro:

  1. Uninstall node installed using brew: brew uninstall node
  2. Manually install node from https://nodejs.org/en/download/releases/.
  3. Run sudo npm install -g aws-azure-login --unsafe-perm

Disclaimer: I have no idea why this works, or if it will generalise to work for others.

Notes:

  • which npm still points to /opt/homebrew/bin/npm while which node now points to /usr/local/bin/node.
  • I have tried using two different versions of node: v14.15.0 and v15.14.0 (the latest one); both seem to work for me.
  • I have tried to later do brew install node and then install aws-azure-login with which node pointing to /opt/homebrew/bin/node. This fails every time.
  • When I go back to using the node version installed directly from nodejs.org, the installation again works seamlessly. This makes me wonder if there is something odd about the node binary provided by brew.

@kennethaasan
Copy link
Collaborator

@e-hulten, thanks for sharing! Hopefully, this helps other people on M1.

@samgegr8
Copy link

samgegr8 commented Jun 2, 2021

@e-hulten Thanks mate , this is the only solution in the present scenario and it helped me

@str4t3gy
Copy link

str4t3gy commented Jun 25, 2021

@e-hulten

Many thanks bro, This is work perfectly !!. I tried many solutions including nvm or brew to install node. most of them won't work with aws-azure-login. but when download from source. It works like a charm.

No need to set PUPPETEER environment variables at all

Screen Shot 2564-06-25 at 13 29 20

  • Running on Mac mini M1
  • Bigsur 11.4

@Ramadanko
Copy link

I have the same issue but its inside docker image

@clarkyeah
Copy link

Tried half a day, this is really works! Thanks so much! @e-hulten

@hermitmaster
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests