我正在嘗試從 GitHub 使用它,我必須為其安裝依賴項。當我運行“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 [email protected]: 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 %
所以它無法下載電子。我用的是蘋果 M1。它沒有安裝是有道理的,因為它試圖安裝不是為 ARM 發布的 Electron v.9.4.4。我如何告訴它安裝更新的 Electron 版本并繼續處理其他依賴項?
uj5u.com熱心網友回復:
如果你已經克隆了 repo,你可以運行
npm install electron@latest --save-dev
這將更新 dev-dependencies 屬性中的包package.json,您可以檢查它以驗證它是否已更新到最新版本
uj5u.com熱心網友回復:
codemirror_mode : xl
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 [email protected]: 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 %
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/429362.html
