cnpm/cnpmjs.org

安装后配置了pg的数据库怎么启动?

zhangsai521314 opened this issue · 1 comments

我的数据库配置
database: { // 数据库名称 db: 'npm', //数据库用户名 username: 'postgres', //数据库用户密码 password: '12', //数据库类型支持: 'mysql', 'sqlite', 'postgres', 'mariadb' dialect: 'postgres', //数据库ip host: '172.21.0.17', //数据库端口 port: 5422, // use pooling in order to reduce db connection overload and to increase speed // currently only for mysql and postgresql (since v1.5.0) pool: { maxConnections: 10, minConnections: 0, maxIdleTime: 30000 }, // the storage engine for 'sqlite' // default store into ~/.cnpmjs.org/data.sqlite storage: path.join(dataDir, 'data.sqlite'), logging: !!process.env.SQL_DEBUG, },
在使用 cnpmjs.org start启动时报下面的错误:
`/bkdata/npm/nodejs/node_global/lib/node_modules/cnpmjs.org/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:27
throw new Error('Please install '' + (sequelize.config.dialectModulePath || 'pg') + '' module manually');
^

Error: Please install 'pg' module manually
at new ConnectionManager (/bkdata/npm/nodejs/node_global/lib/node_modules/cnpmjs.org/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:27:13)
at new PostgresDialect (/bkdata/npm/nodejs/node_global/lib/node_modules/cnpmjs.org/node_modules/sequelize/lib/dialects/postgres/index.js:12:28)
at new Sequelize (/bkdata/npm/nodejs/node_global/lib/node_modules/cnpmjs.org/node_modules/sequelize/lib/sequelize.js:233:18)
at Object. (/bkdata/npm/nodejs/node_global/lib/node_modules/cnpmjs.org/common/sequelize.js:73:17)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object. (/bkdata/npm/nodejs/node_global/lib/node_modules/cnpmjs.org/models/index.js:16:17)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
at Module.require (internal/modules/cjs/loader.js:974:19)
`
我要怎么做?

npm install -g pg