Javascript $(…).jstree不是一个函数,在Electron js中使用jstree

Javascript $(…).jstree不是一个函数,在Electron js中使用jstree,javascript,jquery,electron,jstree,Javascript,Jquery,Electron,Jstree,我正在使用jQuery和jsTree在python中构建一个应用程序。该应用程序在浏览器中正常工作,但当我为我的项目创建electron应用程序时,它显示了这一点 $(…).jstree不是函数 我得到了这个错误 Uncaught Error: Cannot find module 'jquery' at Module._resolveFilename (module.js:485:15) at Function.Module._resolveFilename (/usr/loc

我正在使用
jQuery
jsTree
python
中构建一个应用程序。该应用程序在浏览器中正常工作,但当我为我的项目创建electron应用程序时,它显示了这一点

$(…).jstree不是函数

我得到了这个错误

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
在jQueryCDN链接之后,我还包含了以下脚本

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
        <script>
            try {
                $ = jQuery = module.exports;
            } catch(e) {}
        </script>

试一试{
$=jQuery=module.exports;
}捕获(e){}
来自此:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
        <script>
            try {
                $ = jQuery = module.exports;
            } catch(e) {}
        </script>

试一试{
$=jQuery=module.exports;
}捕获(e){}
更改此项:

 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
            <script>
                try {
                    $.jQuery = module.exports;
                } catch(e) {}
            </script>

试一试{
$.jQuery=module.exports;
}捕获(e){}
你的功能是错误的

您不能执行
$=jquery=“something”
。因此,出现以下错误:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
        <script>
            try {
                $ = jQuery = module.exports;
            } catch(e) {}
        </script>

试一试{
$=jQuery=module.exports;
}捕获(e){}
更改此项:

 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
            <script>
                try {
                    $.jQuery = module.exports;
                } catch(e) {}
            </script>

试一试{
$.jQuery=module.exports;
}捕获(e){}
你的功能是错误的

您不能执行
$=jquery=“something”
。因此错误找到了答案

<!-- Insert this line above script imports  -->
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>

<!-- normal script imports etc  -->
<script src="scripts/jquery.min.js"></script>    
<script src="scripts/vendor.js"></script>    

<!-- Insert this line after script imports -->
<script>if (window.module) module = window.module;</script>

if(typeof module==='object'){window.module=module;module=undefined;}
如果(window.module)module=window.module;
请参阅:

找到了答案

<!-- Insert this line above script imports  -->
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>

<!-- normal script imports etc  -->
<script src="scripts/jquery.min.js"></script>    
<script src="scripts/vendor.js"></script>    

<!-- Insert this line after script imports -->
<script>if (window.module) module = window.module;</script>

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

请参阅:

请提供一些代码。你是如何使用它的。请确保在jQuery脚本之后使用jstree脚本。@AagamJain,它在浏览器中而不是在electron js应用程序中工作。请提供一些代码。你是如何使用它的。请确保jQuery脚本之后的jstree脚本。@AagamJain,它在浏览器中工作,而不是在electron js appNo中,只能通过以下方式完成
$=jQuery=module.exports$=jQuery=module.exports