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

feat(launcher): fix installation error on Apple M1 chips #7099

Merged
merged 4 commits into from Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/node/BrowserFetcher.ts
Expand Up @@ -293,7 +293,10 @@ export class BrowserFetcher {
if (await existsAsync(outputPath)) return this.revisionInfo(revision);
if (!(await existsAsync(this._downloadsFolder)))
await mkdirAsync(this._downloadsFolder);
if (os.arch() === 'arm64') {

// Use intel x86 build on Apple M1 until native MacOS arm64
// chromium builds are available
mathiasbynens marked this conversation as resolved.
Show resolved Hide resolved
if (os.platform() !== 'darwin' && os.arch() === 'arm64') {
handleArm64();
return;
}
Expand Down
4 changes: 3 additions & 1 deletion src/node/Launcher.ts
Expand Up @@ -105,7 +105,9 @@ class ChromeLauncher implements ProductLauncher {

let chromeExecutable = executablePath;
if (!executablePath) {
if (os.arch() === 'arm64') {
// Use intel x86 build on Apple M1 until native MacOS arm64
// chromium builds are available
mathiasbynens marked this conversation as resolved.
Show resolved Hide resolved
if (os.platform() !== 'darwin' && os.arch() === 'arm64') {
chromeExecutable = '/usr/bin/chromium-browser';
} else {
const { missingText, executablePath } = resolveExecutablePath(this);
Expand Down
4 changes: 3 additions & 1 deletion src/node/install.ts
Expand Up @@ -90,7 +90,9 @@ export async function downloadBrowser() {
if (NPM_NO_PROXY) process.env.NO_PROXY = NPM_NO_PROXY;

function onSuccess(localRevisions: string[]): void {
if (os.arch() !== 'arm64') {
// Use intel x86 build on Apple M1 until native MacOS arm64
// chromium builds are available
mathiasbynens marked this conversation as resolved.
Show resolved Hide resolved
if (os.platform() !== 'darwin' && os.arch() !== 'arm64') {
logPolitely(
`${supportedProducts[product]} (${revisionInfo.revision}) downloaded to ${revisionInfo.folderPath}`
);
Expand Down