Linux Pop! distribution (v 17 Ubuntu) Custom-built desktop machine
I've been working for a long time to try to get just a simple sequelize db:migrate
command to work.
I have postgresql installed and if I do su - postgres
and then psql
I can get into the psql commannd prompt (and can also get out, using \q
).
I'm working on a project where we need to use the sequelize-cli manager. I've installed npm i --save sequelize@4.32.6 pg@7.4.1 pg-hstore@2.3.2
.
Then I did sequelize init
in my directory, and adjusted the database files.
const path = require("path");
module.exports = {
"config": path.resolve("./db/config", "config.json"),
"models-path": path.resolve("./db/models"),
"seeders-path": path.resolve("./db/seeds"),
"migrations-path": path.resolve("./db/migrations")
};
And here's my config.json
file for sequelize:
{
"development": {
"username": "postgres",
"password": null,
"database": "address-bloc-dev",
"host": "127.0.0.1",
"dialect": "postgres",
"logging": false
},
"test": {
"username": "postgres",
"password": null,
"database": "address-bloc-test",
"host": "127.0.0.1",
"dialect": "postgres",
"logging": false
}
}
No matter what I do, whenever I try to do sequelize db:migrate
, I get this:
$ sequelize db:migrate
Sequelize CLI [Node: 6.11.4, CLI: 4.0.0, ORM: 4.32.6]
Loaded configuration file "db/config/config.json".
Using environment "development".
sequelize deprecated String based operators are now deprecated. Please use Symbol based operators for better security, read more at http://docs.sequelizejs.com/manual/tutorial/querying.html#operators node_modules/sequelize/lib/sequelize.js:237:13
ERROR: password authentication failed for user "postgres"
I get this error whether I'm logged in as my main, normal user, or when I'm logged in as postgres
. I can su
between the two, navigate to the correct directory, and still get the same result.
I was earlier also getting another error, postgres is not in the sudoers file. This incident will be reported.
.
Per a recommendation on stackoverflow, I tried adding the postgres
user to sudo usermod -a -G sudo postgres
and made postgres
an official account. It shows up on my login screen.
This did manage to make that second sudoers...
error go away.
However, I still ultimately get the same password authentication failure...
error.
I've also tried installing npm both as a regular user, and with the sudo
command.
And I've tried going into the pg_hba.config
file and changing peer
to ident
, per another recommendation on stackoverflow. No luck, still.
Any ideas about why I can't get sequelize-cli to perform this operation?
EDIT: I've received some kind responses, but so far I haven't been able to figure out what I'm doing wrong. Made some notes in a comment. Thank you.