New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read property 'split' of null error #1134
Comments
Can you show your knexfile too? Sounds like the migration path is set wrong there. |
Here it is: module.exports = {
development: {
client: 'pg',
connection: {
database: 'data-api-dev',
user: '',
password: ''
},
migrations: {
tableName: 'knex_migrations'
},
debug: true
},
test: {
client: 'pg',
connection: {
database: 'data-api-test',
user: '',
password: 'password'
},
migrations: {
tableName: 'knex_migrations'
}
},
staging: {
client: 'pg',
connection: {
database: 'data-api-stg',
user: '',
password: 'password'
},
pool: {
min: 2,
max: 10
},
migrations: {
tableName: 'knex_migrations'
}
},
production: {
client: 'pg',
connection: {
database: 'data-api-prod',
user: '',
password: 'password'
},
pool: {
min: 2,
max: 10
},
migrations: {
tableName: 'knex_migrations'
}
}
}; |
I was getting this error when running |
Hi @s2t2 , what does the directory path look like in your knexfile? Is it relative to the knexfile you specified with the cli flag? Or is it from the project root where you're running the I've tried specifying a different knexfile path by running If I leave the knexfile.js in the default location, everything works as expected, fwiw. Thanks a ton! -Nathan |
@NathanKleekamp try relative to the project root. See also http://data-creative.info/process-documentation/2016/04/09/node-for-rails-developers-part-6a-express-postgresql-datastore/ |
@s2t2 Thanks for your help, and nice write up! Here's what ended up working for me in case it's helpful for others. I had installed knex locally, not globally, so to run the knex cli commands, I added a knex script to my "scripts": {
"knex": "knex"
} When trying to create the migrations via Adding the "scripts": {
"knex": "knex --knexfile 'path/to/knexfile.js'"
}, |
Message was really unclear and it doesn't look like that split was doing anything useful, hence I'm getting rid of it. |
Running
knex migrate:make test
produces this error:The text was updated successfully, but these errors were encountered: