db-migrate / node-db-migrate

Database migration framework for node
Other
2.32k stars 360 forks source link

No such driver found, please try to install it via npm install db-migrate-psql #747

Closed nodesocket closed 3 years ago

nodesocket commented 3 years ago

I'm submitting a...

Current behavior

I've installed "db-migrate": "0.11.12" and "db-migrate-pg": "1.2.2", packages but when I execute npx db-migrate up I am shown the error message:

[ERROR] AssertionError [ERR_ASSERTION]: ifError got unwanted exception: No such driver found, please try to install it via npm install db-migrate-psql or npm install -g db-migrate-psql

Expected behavior

Should not need db-migrate-psql. I don't even know what that package is. All the documentation seems to indicate the only package I should need is db-migrate-pg.

Minimal reproduction of the problem with instructions

Environment


db-migrate version: 0.11.12
plugins with versions: 
db-migrate driver with versions: db-migrate-pg 1.2.2

Additional information:
- Node version: v14.17.5
- Platform:  Mac
nodesocket commented 3 years ago

When trying to install the db-migrate-psql package, it doesn't even exist.

MacBook-Pro ➜  server git:(master) ✗ yarn add db-migrate-psql
yarn add v1.22.5
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/db-migrate-psql: Not found".
info If you think this is a bug, please open a bug report with the information provided in "/Users/justin/Sites/watchn/server/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
nodesocket commented 3 years ago

Well, I finally figured it out. I am using the industry standard envar DATABASE_URL without a database.json but I had the wrong prefix in the connection url. I was using psql://..... It needs to be postgres://.... Wow, that was buried real deep.