安装pnpm(我使用了如下的镜像源)
npm config get https://registry.npmmirror.com/
npm install -g pnpm
初始化项目
pnpm init
安装electron
pnpm install electron
输出(安装成功):
Packages: +75
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 75, reused 0, downloaded 75, added 75, done
node_modules/.pnpm/electron@28.0.0/node_modules/electron: Running postinstall script, done in 18.7s
dependencies:
+ electron 28.0.0
Done in 21.7s