https://github.com/electron/electron/releases/download/v9.4.4/electron-v9.4.4-darwin-arm64.zip 的响应代码

Posted

技术标签:

【中文标题】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 【发布时间】:2021-06-27 06:48:00 【问题描述】:

我正在尝试为 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)

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

【问题讨论】:

github.com/electron/electron/releases - 仅显示早于 11.4 的版本 - ? 是的,据我所知,react 调试工具需要 m1 macs 中的电子版本 11.0.1。我想我找到了答案。我会尽快回答这个问题。 【参考方案1】:

React 调试工具需要 m1 mac 中的电子版本 11.0.1。 如所述here 如果使用 Yarn,您可以在 package.json 中添加分辨率条目,指定要安装的版本:

"resolutions": 
  "electron": "^11.0.1"

然后是yarn install

【讨论】:

以上是关于https://github.com/electron/electron/releases/download/v9.4.4/electron-v9.4.4-darwin-arm64.zip 的响应代码的主要内容,如果未能解决你的问题,请参考以下文章