簡體   English   中英

npm 安裝依賴失敗

[英]npm fails to install depencies

我正在嘗試從 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 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。 它沒有安裝是有道理的,因為它嘗試安裝 Electron v.9.4.4,它沒有為 ARM 發布。我如何告訴它安裝更新的 Electron 版本並繼續其他依賴項?

如果你已經克隆了 repo,你可以運行

npm install electron@latest --save-dev

這將更新 package.json 的 dev-dependencies 屬性中的package.json ,您可以檢查它以驗證它是否已更新到最新版本

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM