I am using Electron to create a desktop application. In my application, I load an external site (outside the Atom application), say, the http: //mydummysite/index.html page.
Here is the structure of my application in the Atom editor :

that is, it has the following parts:
main.jspackage.jsonnodemodules>jquery (to load jquery)
Source:
main.js:
'use strict'; var app = require('app'); app.on('ready', function() { var BrowserWindow = require('browser-window'); var win = new BrowserWindow({ width: 800, height: 600, show: false, 'node-integration':true }); win.on('closed', function() { win = null; }); win.loadUrl('http://mydummysite/index.html '); win.show(); });
package.json:
{ "name": "my-mac-app", "version": "5.2.0", "description": "My Mac Desktop App", "main": "main.js", "scripts": { "start": "electron ." }, "author": "Me", "license": "ISC", "dependencies": { "jquery": "^2.1.4" } }
External page - http: //mydummysite/index.html page code:
<!DOCTYPE html> <html> <head> </head> <body> <h1>Hello World!</h1> </body> <script> var jqr=require('jquery'); </script> </html>
When I launch the above application (by dragging and dropping the application folder into Electron), the external page ( http: //mydummysite/index.html ) is loaded into the Electron shell. but with an error
Uncaught Error: cannot find module 'jquery'

Can you help me find the cause of this problem?
As you can see in my screenshot of the directory structure, I already installed the jquery module in my folder and did this with the npm install jquery command.
Note. To play with the require command in JS, I tried adding require("ipc") to the http: //mydummysite/index.html page of the external page, and it worked, which could be the reason with require("jquery") .
Have I added the external module (jquery) to Electron correctly?
Am I missing some kind of dependency in package.json ?
What I already tried:
npm cache clean , npm install jquery (to my application folder)npm install --save jquerynpm install jquery -gnpm rebuildsudo npm install jquery -gsudo npm install jqueryexport NODE_PATH=/usr/local/lib/node_modules
Here is a screenshot of the location from which an error is issued in module.js

Can someone tell require("ipc") why require("ipc") works, but require("jquery") does not?
My goal is to use jQuery with an electronic application with a node integration version.