Loading jquery from spawned express


hey guys,
so i’m spawning express webserver from electron, and loading localhost index in browser url, when page loads it can’t find jquery even though its in node_modules for both the express server & electron.
What am I doing wrong?


const expressAppUrl = "http://localhost:3000/admin",
spawn = require("child_process").spawn,
node = spawn("node.exe", ["./express/bin/www"]);

let win;
function createWindow() {
    let win = new BrowserWindow({width: 800, height: 600} )


        window.$ = window.jQuery = require('jquery');


this also doesn’t work…
window.$ = window.jQuery = require(’./node_modules/jquery/dist/jquery.min.js’);


Why are you running a web server to launch an Electron app?


thank you for the reply.
the solution that worked for me (for future generations) is below, i’ll answer your question in a new thread i’ll open because I do have a few questions

Insert this line above script imports

if (typeof module === 'object') {window.module = module; module = undefined;}

Insert this line after script imports

if (window.module) module = window.module;