Below I will share with you an article to solve the problem of slow network timeout and failure of npm installation of Electron. It has a good reference value and I hope it will be helpful to everyone.
The Electron framework, formerly known as Atom Shell, allows you to write cross-platform desktop applications using JavaScript, HTML and CSS. It is based on io.js and Chromium open source projects. The editor encountered npm installation of Electron that failed due to slow network timeout. Let's take a look.
1. If the npm source is too slow, you can switch the source to the domestic Taobao mirror.
npm config set registry https://registry.npm.taobao.org
2. Download the latest installation from the domestic image of electron package, mainly focus on the version corresponding to your system
https://npm.taobao.org/mirrors/electron
##3. Download Good packages are placed in the .electron folder in the root directory of the current user. Windows is generally
C:\Users\YourUserName\.electron4. Execute the installation command npm install electron-prebuilt -g
The above is what I compiled for you. I hope it will be helpful to you in the future. Related articles:Implementing date selection component in vue mobile terminal
How to use iconfont font icon in webpack
How to package specified JS files separately in webpack
The above is the detailed content of Failure to install Electron using npm. For more information, please follow other related articles on the PHP Chinese website!