gpt4 book ai didi

node.js - Sequelize 需要

转载 作者:行者123 更新时间:2023-12-03 22:29:26 25 4
gpt4 key购买 nike

我第一次尝试使用 sequelize,但出现此错误:

Uncaught ReferenceError: require is not defined

控制台提示错误出现在这一段:
    var Sequelize  = require("sequelize")
, sequelize = new Sequelize('database', 'myusrname', 'mypass', {
dialect: "mysql",
port: 3306
});

我应该怎么办?

最佳答案

试试这个:

var Sequelize = require('sequelize');
var sequelize = new Sequelize(database, user, password,{
dialect: 'mysql',
port: 3306,
});

关于node.js - Sequelize 需要,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27938566/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com