我从npm软件包管理器安装了gentelella模板,我试图包括这样的PNotify脚本(顶部包括CSS):

<!-- jQuery -->
<script src="node_modules/gentelella/vendors/jquery/dist/jquery.min.js"></script>

<!-- PNotify -->
<script src="node_modules/gentelella/vendors/pnotify/dist/pnotify.js"></script>

但是,当我执行应用程序时,出现此错误:
pnotify.js:6 Uncaught TypeError: b is not a function
at q (pnotify.js:6)
at pnotify.js:31
at pnotify.js:6
at pnotify.js:6

但是当我使用浏览器执行index.html时可以正常工作,为什么?

谢谢!

最佳答案

看来jquery无法正确加载。

我做到了,它奏效了:

Electron: jQuery is not defined

关于javascript - 未捕获的TypeError : b is not a function in nodejs(electron),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/43824599/

10-10 12:55