Under the hood, Electron's JavaScript API binds to a binary that contains itsimplementations. Because this binary is crucial to the function of any Electron app,it is downloaded by default in the postinstall step every time you install electronfrom the npm registry.
However, if you want to install your project's dependencies but don't need to useElectron functionality, you can set the ELECTRON_SKIP_BINARY_DOWNLOAD environmentvariable to prevent the binary from being downloaded. For instance, this feature canbe useful in continuous integration environments when running unit tests that mockout the electron module.
In almost all cases, these errors are the result of network problems and notactual issues with the electron npm package. Errors like ELIFECYCLE,EAI_AGAIN, ECONNRESET, and ETIMEDOUT are all indications of suchnetwork problems. The best resolution is to try switching networks, orwait a bit and try installing again.
Due to certain suggestions received from different articles, we have decided to use the "npm ci" to install the node dependencies from package-lock.json file to avoid breaking changes instead of using the "npm install" script.
There are a couple solutions, none of them are strictly wrong. You can either configure npm so it installs globally to your home, or avoid using -g entirely. It is also possible, for node versions 8 and greater, to use npx.
This is a bit harder to implement, but creates a bit more strictness in your environment; it will be impossible accidentally make use of what would have been a globally installed package. The idea is to install it to either a temporary transitory folder or to the project folder, then run the locally installed instance of the package, the binaries are found under node_packages/.bin/.[2]
caa09b180b