gpt4 book ai didi

knex.js - "no commandline connection parameters passed"Knex错误

转载 作者:行者123 更新时间:2023-12-03 08:55:56 31 4
gpt4 key购买 nike

我正在尝试使用命令运行 knexfile 迁移

knex 迁移:最新

并收到以下错误

/Users/<MYUSERNAME>/.npm-global/lib/node_modules/knex/bin/utils/cli-config-utils.js:8
throw new Error(
^

Error: No default configuration file '/Users/<MYUSERNAME>/Desktop/Zipline/ed-tester/knexfile.js' found and no commandline connection parameters passed
at mkConfigObj (/Users/<MYUSERNAME>/.npm-global/lib/node_modules/knex/bin/utils/cli-config-utils.js:8:11)

我的 knexfile.js

module.exports = {

development: {
client: 'postgresql',
connection: {
database: process.env.DB_NAME || 'db',
user: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD,
host: process.env.DB_HOSTNAME,
},
pool: {
min: 2,
max: 10
},
migrations: {
tableName: 'knex_migrations'
}
}
};

和我的.env

DB_USERNAME=postgres
DB_HOSTNAME=localhost
DB_NAME=db
DB_PASSWORD=
DB_SSL=false

有人可以解释一下出了什么问题以及如何修复吗?

最佳答案

尝试运行以下命令-knex migrate:latest --envdevelopment

关于knex.js - "no commandline connection parameters passed"Knex错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55448374/

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