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

"npm install" errors with "Failed to find Electron v1.7.11 for darwin-arm64" #167

Open
klyap opened this issue Feb 23, 2023 · 1 comment

Comments

@klyap
Copy link

klyap commented Feb 23, 2023

npm ERR! npm ERR! Error: Failed to find Electron v1.7.11 for darwin-arm64 at https://github.com/electron/electron/releases/download/v1.7.11/electron-v1.7.11-darwin-arm64.zip

This seems to be an issue specifically for running on M1 Macbooks.

@sunnypranay
Copy link

Hello @klyap,

It appears that the Electron version you're trying to use is not compatible with the arm64 architecture of your Apple Silicon Mac when using a version of Node.js newer than v12. To address this, you can use Node Version Manager (nvm) to install and manage an older Node.js version. However, since the required version of Electron is not available for arm64, you will need to run your terminal under Rosetta, which allows you to use software designed for Intel x86 architecture.

Here's a step-by-step guide to resolve the issue:

  1. Install Rosetta 2 (if not already installed):

    Open the terminal and run the following command:

    /usr/sbin/softwareupdate --install-rosetta --agree-to-license
  2. Open Terminal using Rosetta:

    • Find the Terminal application in Finder (usually under Applications > Utilities).
    • Duplicate Terminal (so you have the original version intact).
    • Right-click on the duplicated Terminal and select "Get Info."
    • Check the box for "Open using Rosetta" and close the info window.
  3. Install nvm:

    Open the Rosetta Terminal and install nvm by running the script from their GitHub repository (https://github.com/nvm-sh/nvm). You can usually do this with the following command:

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash

    (Make sure to use the latest installation script from the nvm GitHub page.)

  4. Close and reopen the Terminal:

    This is to ensure the nvm commands are available in your terminal session. Open the Rosetta Terminal again.

  5. Install and use Node.js v11:

    With nvm now installed, you can install Node.js v11 with:

    nvm install 11
    nvm use 11
  6. Verify the Node.js version:

    Ensure you're now using the correct Node.js version with:

    node -v
  7. Proceed with Electron installation:

    Now, try installing Electron again or running your npm commands that were failing previously.

Please let me know if this resolves your issue, or if you run into any more trouble!

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

2 participants