在 M1 上运行 npm install 时无法在我的 Next.js 项目上安装 Electron

问题描述 投票:0回答:0

刚刚从 GitHub 克隆了一个自由职业项目,我正在尝试安装 npm install,但我遇到了这个困扰我好几天的问题。这是关于电子的。我将在此处发布错误以及我的 JSON 文件。希望有人能帮我解决。非常感谢

npm ERR! code 1
npm ERR! path /Users/lauraioana/Downloads/programming/portfolio/aih/frontend/node_modules/electron
npm ERR! command failed
npm ERR! command sh -c node install.js
Downloading electron-v2.0.18-darwin-arm64.zip
npm ERR! Error: GET https://github.com/electron/electron/releases/download/v2.0.18/electron-v2.0.18-darwin-arm64.zip returned 404
npm ERR! /Users/lauraioana/Downloads/programming/portfolio/aih/frontend/node_modules/electron/install.js:54
npm ERR!   throw err
npm ERR!   ^
npm ERR!
npm ERR! Error: Failed to find Electron v2.0.18 for darwin-arm64 at https://github.com/electron/electron/releases/download/v2.0.18/electron-v2.0.18-darwin-arm64.zip
npm ERR!     at Request.<anonymous> (/Users/lauraioana/Downloads/programming/portfolio/aih/frontend/node_modules/nugget/index.js:169:61)
npm ERR!     at Request.emit (node:events:527:28)
npm ERR!     at Request.onRequestResponse (/Users/lauraioana/Downloads/programming/portfolio/aih/frontend/node_modules/request/request.js:1059:10)
npm ERR!     at ClientRequest.emit (node:events:527:28)
npm ERR!     at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:631:27)
npm ERR!     at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
npm ERR!     at TLSSocket.socketOnData (node:_http_client:494:22)
npm ERR!     at TLSSocket.emit (node:events:527:28)
npm ERR!     at addChunk (node:internal/streams/readable:315:12)
npm ERR!     at readableAddChunk (node:internal/streams/readable:289:9)

npm ERR! A complete log of this run can be found in: /Users/lauraioana/.npm/_logs/2023-04-29T06_32_12_505Z-debug-0.log

package.json

{
  "name": "aig-frontend",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@auth0/nextjs-auth0": "^1.9.1",
    "@chakra-ui/icons": "^2.0.2",
    "@chakra-ui/react": "^2.2.1",
    "@emotion/react": "^11",
    "@emotion/styled": "^11",
    "@zoralabs/zdk": "^2.1.2",
    "chart.js": "^3.8.2",
    "ethers": "^5.6.9",
    "framer-motion": "^6",
    "js-priority-queue": "^0.1.5",
    "leaflet": "^1.8.0",
    "mongodb": "^4.7.0",
    "next": "12.1.6",
    "next-auth": "^4.8.0",
    "nightmare": "^3.0.2",
    "number-abbreviate": "^2.0.0",
    "open-graph-scraper": "^4.11.1",
    "react": "18.2.0",
    "react-autosuggest": "^10.1.0",
    "react-chartjs-2": "^4.3.1",
    "react-dom": "18.2.0",
    "react-leaflet": "^4.0.1",
    "react-leaflet-universal": "^2.2.1",
    "react-slideshow-image": "^4.0.4",
    "recoil": "^0.7.4",
    "recoil-persist": "^4.2.0",
    "siwe": "^1.1.6",
    "truncate-eth-address": "^1.0.2",
    "use-nft": "^0.12.0",
    "wagmi": "^0.5.6"
  },
  "devDependencies": {
    "eslint": "8.17.0",
    "eslint-config-next": "12.1.6",
    "yarn-audit-fix": "^9.3.7"
  }
}

我尝试了浏览器窗口的东西虽然我不确定我是否正确(不知道把它放在哪里)并且我尝试在终端中安装 Electron @latest。只有错误。另外,如果我转到那个链接,它说要在 GitHub 上获取 Electron 版本,它会说“找不到”...

reactjs npm electron npm-install next
© www.soinside.com 2019 - 2024. All rights reserved.