npm 无法安装依赖项

npm fails to install depencies

我正在尝试使用 GitHub 中的 this,我必须为其安装依赖项。当我 运行 “npm install” 时,出现以下错误。

Last login: Sat Feb 19 20:41:00 on ttys000
jakob@Jakobs-MacBook-Air ~ % cd Desktop/unredacter 
jakob@Jakobs-MacBook-Air unredacter % npm install
npm WARN old lockfile 
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile 
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile 
npm WARN deprecated debug@4.2.0: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm ERR! code 1
npm ERR! path /Users/jakob/Desktop/unredacter/node_modules/electron
npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! HTTPError: Response code 404 (Not Found) for https://github.com/electron/electron/releases/download/v9.4.4/electron-v9.4.4-darwin-arm64.zip
npm ERR!     at EventEmitter.<anonymous> (/Users/jakob/Desktop/unredacter/node_modules/got/source/as-stream.js:35:24)
npm ERR!     at EventEmitter.emit (node:events:526:28)
npm ERR!     at module.exports (/Users/jakob/Desktop/unredacter/node_modules/got/source/get-response.js:22:10)
npm ERR!     at ClientRequest.handleResponse (/Users/jakob/Desktop/unredacter/node_modules/got/source/request-as-event-emitter.js:155:5)
npm ERR!     at Object.onceWrapper (node:events:646:26)
npm ERR!     at ClientRequest.emit (node:events:538:35)
npm ERR!     at ClientRequest.origin.emit (/Users/jakob/Desktop/unredacter/node_modules/@szmarczak/http-timer/source/index.js:37:11)
npm ERR!     at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:618:27)
npm ERR!     at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
npm ERR!     at TLSSocket.socketOnData (node:_http_client:482:22)

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jakob/.npm/_logs/2022-02-19T19_41_32_484Z-debug-0.log
jakob@Jakobs-MacBook-Air unredacter % 

所以下载Electron失败。我正在使用 Apple M1。它没有安装是有道理的,因为它试图安装没有为 ARM 发布的 Electron v.9.4.4。我如何告诉它安装更新的 Electron 版本并继续其他依赖项?

如果你已经克隆了 repo,你可以 运行

npm install electron@latest --save-dev

这将更新 package.json dev-dependencies 属性 中的包,您可以检查它是否已更新到最新版本