javascript - 未捕获的类型错误 : b is not a function in nodejs(electron)

标签 javascript node.js electron

我从 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 - 未捕获的类型错误 : b is not a function in nodejs(electron),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43824599/

相关文章:

javascript - 用 JavaScript 替换 JSON 中的字符串

javascript - Canvas 中的动画不连贯

node.js - Mongoose 查找默认值

sqlite - 在Electron和Ionic 4中使用sqlite3

electron - 在 ASAR 中找不到 PNG 文件

npm - 如何使用 Electron 复制文件

javascript - 表单验证 JavaScript 数字总是返回 false

javascript - 在 typescript 中访问 Nodejs 流的 highWaterMark 属性给出 : "Property ' _readableState' does not exist"error

node.js - 为什么 webpack 会多出 10,000 行?

mysql - 在 SQL 中聚合模型 "through"其他模型?