https://github.com/electron/electron/releases/download/v9.4.4/electron-v9.4.4-darwin-arm64.zip 的响应代码 404(未找到)

Response code 404 (Not Found) for https://github.com/electron/electron/releases/download/v9.4.4/electron-v9.4.4-darwin-arm64.zip

我正在尝试为 M1 macbook pro 中的 React Native 项目安装节点模块。在尝试 运行 npm installyarn install 时出现此错误。

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)

我无法找到我的哪些包正在使用 electron,因为我无法升级 electron 的版本。

React 调试工具在 m1 macs 中需要 electron 版本 11.0.1。 如上所述 here
如果使用 Yarn,您可以向 package.json 添加一个解决方案条目,指定要安装的版本:

"resolutions": {
  "electron": "^11.0.1"
}

然后是yarn install.