Open Andrew-web-coder opened 1 year ago
You need to use await
just wrap it in a function:
const electronInstaller = require('electron-winstaller');
async function e() {
try {
await electronInstaller.createWindowsInstaller({
appDirectory: '/tmp/build/my-app-64',
outputDirectory: '/tmp/build/installer64',
authors: 'My App Inc.',
exe: 'myapp.exe'
});
console.log('It worked!');
} catch (e) {
console.log(`No dice: ${e.message}`);
}
}
e();
I suggest this be closed - @Andrew-web-coder can you do so?
You need to use await
just wrap it in a function:
const electronInstaller = require('electron-winstaller'); async function e() { try { await electronInstaller.createWindowsInstaller({ appDirectory: '/tmp/build/my-app-64', outputDirectory: '/tmp/build/installer64', authors: 'My App Inc.', exe: 'myapp.exe' }); console.log('It worked!'); } catch (e) { console.log(`No dice: ${e.message}`); } } e();
I tried it this way, and it still doesn't work
Debugger listening on ws://127.0.0.1:53850/2fa076bc-135f-4a6b-aedf-e9793d2237da For help, see: https://nodejs.org/en/docs/inspector Debugger attached. No dice: ENOENT: no such file or directory, open '/tmp/build/my-app-64/resources/app/package.json' Waiting for the debugger to disconnect...
I copy pasted the code from the docs, the result is:
I deleted
await
and the result is:I do not understand why it tries to use incorrect path.
So, how to use it correctly?