To fix Uncaught Error: Cannot find module ‘jquery’ with Node Electron app, we need to add the jQuery script into our HTML file.
For instance, we write
<!DOCTYPE html>
<html>
<head></head>
<body>
<h1>Hello World!</h1>
</body>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script>
window.jQuery = window.$ = jQuery;
$(document).ready(function () {
console.log("jQuery is loaded");
});
</script>
</html>
to add the jQuery script with
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>