npm无法安装dependencies



我正试图从GitHub使用它,我必须为它安装依赖项;npm安装";它给了我以下错误。

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。我用的是苹果M1。它没有安装是有道理的,因为它试图安装没有为ARM发布的Electron v.9.4.4。我如何告诉它安装一个新的Electron版本并继续其他依赖项?

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

npm install electron@latest --save-dev

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

最新更新