- Note: It is best to run the node in administrator mode using the built-in CMD window; otherwise, the installation may fail
Description: Error message is reported during the project upgrade electron 12x.
Solution: Install the electron globally first, and uninstall it after successful installation (note: Use the Node window, run in administrator mode, do not use the Windows provided by the system, otherwise the installation may fail).
NPM I electron -g NPM uninstall electron -g// You can decide whether to reserve the electron globallyCopy the code
Environment requirements: Node 12x or higher (currently using Node 14x)
Network requirements: it is best to open scientific Internet, open global mode, can also configure the proxy, here do not do the description, personal mind is best not to configure the NPM proxy, if the configuration error may lead to local NPM failure, so that you can not install any other plug-ins)
Finally, the installation can be successful.
NPM I electron -s // Operate in the project.Copy the code
- Note: you can first try to install without scientific Internet, and then use scientific Internet or configuration agent if it fails, because sometimes you can also successfully open scientific Internet.
Note: if the following error is reported, prove that your computer before and installed another version, can be deleted according to the corresponding path, and then install.
Picture: I amin the C: Users\admin\AppData\Roaming\ NPM \ directory, find the relevant files are deleted. Then install the electron globally.
The following interface shows that the installation has started. Wait until the installation is complete.