node.js - 如何在 nodejs 中使用 MaterializeCSS?

标签 node.js materialize

我已经运行了以下命令:

npm install materialize-css --save
npm install hammerjs --save
npm install jquery --save

然后在我的 app.js 中,var materialize = require('materialize-css');

但是当我运行 npm start 时,我总是会得到同样的错误:

/Users/myname/code/websites/n-website/node_modules/materialize-css/bin/materialize.js:1
eof require?$=require("jquery"):$}jQuery.easing.jswing=jQuery.easing.swing,jQu
                                                                    ^
TypeError: Cannot read property 'swing' of undefined
    at Object.<anonymous> (/Users/nyname/code/websites/n-website/node_modules/materialize-css/bin/materialize.js:1:195)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/myname/code/websites/n-website/app.js:9:19)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

我找不到其他人遇到这些问题,所以这一定是我尝试使用 MaterializeCSS 的方式。我究竟做错了什么?我只想使用 materialize.toast("Message sent", 5000); 来显示失败的 toast。没什么特别的。

最佳答案

Materializecss 是 gui/网站的前端框架,不适用于您的服务器端 js 应用程序

关于node.js - 如何在 nodejs 中使用 MaterializeCSS?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37823496/

相关文章:

node.js - 如何使用 Firebase 管理 API 创建密码重置链接?

node.js - Amazon S3 403 禁止错误适用于 KML 文件,但不适用于 JPG 文件

javascript - Electron 中 MaterializeCSS 中的所有输入表单看起来都被粉碎了

html - Materialise - 如何知道我们可以设置的类选项?

javascript - 物化轮播的交错显示,同时以模态显示它们

slider - Materialise - 全屏 slider 和导航栏

javascript - 如何检查node.js中的两个事件

node.js - 在为 Electron 构建 SQLite 模块后,如何修复这些运行时错误?

node.js - connect-redis - 如何保护 session 对象免受竞争条件的影响

css - 更改选项卡文本的颜色和物化框架中的下划线