Yarn install Electron遇到couldn't be built successfully——2026解决方案
研究项目时遇到Yarn install electron fail。
报错couldn't be built successfully
log提示:
# This file contains the result of Yarn building a package (electron@npm:37.10.3)
# Script name: postinstall
RequestError: unable to verify the first certificate; if the root CA is installed locally, try running Node.js with --use-system-ca没有弄明白具体的问题,猜测是TLS策略?总之按照Claude的建议,设置了两个环境变量解决。
$env:ELECTRON_MIRROR = "https://npmmirror.com/mirrors/electron/"
$env:npm_config_electron_mirror = "https://npmmirror.com/mirrors/electron/"