<< return
Finding the electron-in-chromium folder instead of an electron folder in node_modules is not correct. This indicates a problem with the Electron installation or potentially the version of Electron you have in your devDependencies. Very old electron versions were installed as electron-prebuilt in the node_modules folder. Modern electron versions use the electron folder to contain binary files.
The electron-in-chromium folder might appear due to dependencies of other packages that embed Electron in Chromium or attempt to bundle Electron differently, or by outdated Electron packages and outdated installation processes. By cleaning up, specifying a correct and more modern Electron version, and reinstalling, you ensure that Electron is installed directly as expected by npm and Electron applications.
So,
- 1. Remove electron-in-chromium: Delete the electron-in-chromium folder, and if there is an electron folder delete that as well. Also, remove node_modules and package-lock.json:
# rm -rf node_modules package-lock.json electron-in-chromium
# npm install --save-dev electron@<version>
Replace <version> with the major version number. If using minor versions such as 33.3.0 replace <version> with 33.3.0. If not using the major version number, make sure to always install the latest patch version for each minor version if sticking with older Electron versions, as older versions might have security issues addressed by later patches.
# .\node_modules\.bin\electron -v
Ensure that the path to the electron executable is correct. If the electron binary is in place, then it should display the installed Electron version.
If you get an error, then something is still wrong with the installation process. It's likely an npm or system configuration problem.
|