Electron Forge安装依赖失败

前言

最近在写Electron的时候,遇到一个很奇怪的问题,执行 yarn 安装依赖总是失败,找遍全网也没有解决方法,记录一下。

问题

执行 yarn 命令后,报错:

error Couldn't find match for "06b29aafb7708acef8b3669835c8a7857ebc92d2" in "refs/heads/dependabot/github_actions/actions/checkout-5,refs/heads/dependabot/github_actions/actions/setup-node-5,refs/heads/dependabot/github_actions/actions/setup-python-6,refs/heads/felixr-optional-chaining,refs/heads/felixr-private-fields,refs/heads/main,refs/heads/release-please--branches--main--components--node-gyp,refs/heads/release-please--branches--main--components--node-gyp--release-notes" for "https://github.com/electron/node-gyp.git".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command

解决方法

根据 electron-forge 文档手动配置,然后执行 cnpm install(没装cnpm先装一下)

posted @ 2026-01-07 19:59  yeying-xingchen  阅读(22)  评论(0)    收藏  举报