Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
I'm trying to install node modules for react native project in M1 macbook pro. While trying to run
npm install
or
yarn install
I'm having this error.
error /Users/akash/Documents/Projects/business-hub/node_modules/electron: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: /Users/akash/Documents/Projects/business-hub/node_modules/electron
Output:
HTTPError: Response code 404 (Not Found) for https://github.com/electron/electron/releases/download/v9.4.4/electron-v9.4.4-darwin-arm64.zip
at EventEmitter.<anonymous> (/Users/akash/Documents/Projects/business-hub/node_modules/got/source/as-stream.js:35:24)
at EventEmitter.emit (node:events:369:20)
at module.exports (/Users/akash/Documents/Projects/business-hub/node_modules/got/source/get-response.js:22:10)
at ClientRequest.handleResponse (/Users/akash/Documents/Projects/business-hub/node_modules/got/source/request-as-event-emitter.js:155:5)
at Object.onceWrapper (node:events:476:26)
at ClientRequest.emit (node:events:381:22)
at ClientRequest.origin.emit (/Users/akash/Documents/Projects/business-hub/node_modules/@szmarczak/http-timer/source/index.js:37:11)
at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:636:27)
I'm unable to find which of my packages are using electron for that I can not upgrade the version of electron.
–
React debugging tools require electron version 11.0.1 in m1 macs.
As described here
If using Yarn, you can add a resolutions entry to package.json specifying which version to install:
"resolutions": {
"electron": "^11.0.1"
and then yarn install
.
The correct solution is by upgrading electron. But, if for some reason you cannot do it (for example you need to build an old application on x86_64/i386 architecture that cannot be upgraded), you can run the Terminal using Rosetta:
1 - Locate Terminal on Finder (generally under Applications/Utilities)
2 - Right-click the Terminal icon and select Get Info.
3 - Check the Open with Rosetta option
After that, you can open the terminal and use the arch command to check if it is running in the correct architecture.
Then just run npm install.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.