对于一个使用SQL全栈生成器的应用程序,我真的需要使用Postgres吗?即使我在生成器请求数据时从控制台选择了MySQL,当我运行"grunt serve‘时也会导致这个错误
my-new-project/node_modules/sequelize/lib/sequelize.js:182
throw new Error('The dialect ' + this.getDialect() + ' is not supported. (
^ Error: The dialect postgres is not supported. (Error: Cannot find module 'pg-hstore')
at new Sequelize (/Users/TerryBu/Desktop/Nestle Related/my-new-project/node_modules/sequelize/lib/sequelize.js:182:11)
at Object.<anonymous> (/Users/TerryBu/Desktop/Nestle Related/my-new-project/server/api/index.js:8:17)
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 module.exports (/Users/TerryBu/Desktop/Nestle Related/my-new-project/server/routes.js:13:3)
at Object.<anonymous> (/Users/TerryBu/Desktop/Nestle Related/my-new-project/server/app.js:17:20)
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 Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)https://www.npmjs.com/package/generator-sql-fullstack
我猜这是因为server/config/environment/development.js如下所示,但我如何将其更改为在后台运行的mysql db?
'use strict';
// Development specific configuration
// ==================================
module.exports = {
// MongoDB connection options
mongo: {
uri: 'mongodb://localhost/mygeneratorproject-dev'
},
// Postgres connection options
postgres: {
uri: process.env.POSTGRES_URL ||
'postgres://user:pass@localhost:5432/mygeneratorproject'
},
database: 'test',
username: 'postgres',
password: 'root',
seedDB: true
};发布于 2015-09-10 05:32:25
此模块尚未准备好进入primetime。它不会设置mysql依赖项,也不会在生成的文件中填充mysql连接器信息,无论您在安装过程中选择了什么。默认为postgres。这个项目的git构建也失败了。它看起来像是开始了,然后又被放弃了--文档比生成器代码更深入。
https://stackoverflow.com/questions/31553068
复制相似问题