cordova-electron
cordova-electron copied to clipboard
Cannot find module: './cdv-electron-settings.json'
Bug Report
Problem
I am able to build an Electron in Windows10, but when I try to install it, I'm getting an error that says Cannot find module: './cdv-electron-settings.json'

Information
build.json
{
"electron": {
"windows": {
"package": ["zip"]
}
}
}
config.yml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.sageipad.sage" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="electron">
<preference name="ElectronSettingsFilePath" value="res/electron/settings.json" />
</platform>
<hook type="before_prepare" src="scripts/prebuild.js" />
<preference name="EnableViewportScale" value="true" />
</widget>
res/electron/settings.json
{
"browserWindow": {
"width": 1024,
"height": 768,
"resizable": true
}
}
Environment, Platform, Device
Electron on Windows 10
Checklist
- [x ] I searched for existing GitHub issues
- [ x] I updated all Cordova tooling to most recent version
- [x ] I included all the necessary information above
I tried locally and was unable to reproduce this issue on Windows 10.
Could you confirm if you still have this problem? Also, maybe try with the latest Cordova Electron 3.0.0?
To upgrade:
cordova platform remove electron
cordova platform add [email protected]
I noticed you had a hookscript , scripts/prebuild.js
, which maybe is causing the issue.