I have build an node.js, express.js app, electron app and in operating system Windows. I have packaged the electron app through the tutorial: How to package an electron app
The packaging to win32 is successful without any warning or errors.
However when I try to run the app.exe file from the dist folder, though the main application window shows up but I cannot see any content that I have in my express.js app folder.
My app folder structure is:
app-root<br>
- express-app
- bin
- www
- node_modules
- public
- routes
- views
- app.js
- package.json
- node_modules
- build
- index.html
- main.js
- package.json
- start-electron.js
- dist<br>
Now The node.js, express.js app in electron runs smoothly normally before packaging. The app does not run from the exe file after packaging.
This is the error in console for the package .exe file:
events.js:163 Uncaught Error: spawn node ENOENT
at exports._errnoException (util.js:1050:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:367:16)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
I have the SPAWN function in the index.html as:
spawn = require("child_process").spawn,
app = require('electron').remote.app,
node = spawn("node", ["./express-app/bin/www"], {
cwd: app.getAppPath()
})
Any kind of help will be appreciated.