yarn add electron installation electron error

When installing the dependencies of the Electron application, I found that node_modules has been installed, but I have been stuck in the installation of electron. In fact, the installer will go to the official website of electron to download the program of the specified version of electron, so there are only two ways to speed up:

Download the binary package in advance (I didn't succeed)
and set Electron's environment variables (successfully)
 

 Always stuck at the last one, and finally reported an error

Solution:

Switch the npm mirror source:

npm config set ELECTRON_MIRROR https://npm.taobao.org/mirrors/electron/

Or switch the yarn mirror source

 yarn config set ELECTRON_MIRROR https://npm.taobao.org/mirrors/electron/

solved

 

Guess you like

Origin blog.csdn.net/qq_60575429/article/details/130910139