I'm building an app in python
django
using the jQuery
and jsTree
. The app is working the browser properly, but when I create the electron app for my project it's showing that
$(...).jstree is not a function.
I am getting this error
Uncaught Error: Cannot find module 'jquery'
at Module._resolveFilename (module.js:485:15)
at Function.Module._resolveFilename (/usr/local/lib/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at http://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.5/jstree.min.js:2:146
at http://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.5/jstree.min.js:2:175
I also included the following script after the jquery CDN link.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
try {
$ = jQuery = module.exports;
} catch(e) {}
</script>