Skip to content
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

Node-pg-migrate not working when I upgrade Node from 12 - 16 #887

Open
jeevanthomas opened this issue Mar 25, 2022 · 7 comments
Open

Node-pg-migrate not working when I upgrade Node from 12 - 16 #887

jeevanthomas opened this issue Mar 25, 2022 · 7 comments
Labels
has workaround Workaround provided or linked s: awaiting more info Additional information are requested s: pending triage Pending Triage

Comments

@jeevanthomas
Copy link

Hi,
I have been working on a project using Node 12.20.1 . When I tried upgrading to the latest version of Node I realized that

> node-pg-migrate "up" command is not working. I am not getting any errors thrown at my terminal, but the existing migration scripts are not running. Can someone please check

I am using 3.18.1 version of node-pg-migrate, I tried upgrading it to 6.2.1 , but that doesn't seem to help. Is there something else I need to do ?

@mike-usa
Copy link

mike-usa commented Apr 30, 2022

Do you have a migration example to test with?

My setup works:

$ node -v
v16.14.2

$ npx node-pg-migrate --version
6.2.1

# Postgres
# show server_version;
 server_version 
----------------
 14.2
(1 row)

Ensure you're running the local version of node-pg-migrate and not a global version.

@Klyyssi
Copy link

Klyyssi commented May 23, 2022

I have this problem as well. node-pg-migrate up command does not return any message nor does it execute migrations. Node versions 12 and 13 seem to work OK.

Affected versions (at least):

  • Ubuntu 20.04 LTS
  • node-versions 13,14,16,18
  • node-pg-migrate 5.6.0, 6.2.1

@mbaquerizo
Copy link

I am seeing the same issue.

  • node v 16.18.1
  • node-pg-admin v6.2.2
  • postgres v11.16

Could this be due to the postgres version?

@Taschee
Copy link

Taschee commented Feb 8, 2023

We also have this problem; Migrations ran successfully with node version 12.22.12, after upgrading to node 16 the node-pg-migrate up does not fail but does not seem to do anything.

  • node v 16.19.0
  • node-pg-migrate v6.2.2
  • postgres:9.6.3-alpine

@Taschee
Copy link

Taschee commented Feb 9, 2023

Found the solution (at least for me):
After updating node (and node-pg-admin to 6.2.2), node-pg-migrate still had "pg" version 7.18.2 as transitive dependency.
After installing "pg" version 8.9.0 manually, everything works again.

Root cause seemed to lie somewhere in the pg client connecting to pg;

I managed to reproduce the error in a minimal example (with postgres:9.6.3-alpine image as well):

package.json:

{
"name": "test-node-pg-migrate",
"version": "1.0.0",
"dependencies": {
"node-pg-migrate": "6.2.2",
"pg": "7.18.2"
},
"scripts": {
"migrate-up": "node-pg-migrate -f ./pg-migrate-dev.json up",
"migrate-down": "node-pg-migrate -f ./pg-migrate-dev.json down"
}
}

So when using node 16, node-pg-migrate does not seem to work with pg version 7.18.2 (and probably other versions of pg as well). I guess having pg >= 8 as dependency would make sense.

@mbaquerizo
Copy link

Found the solution (at least for me): After updating node (and node-pg-admin to 6.2.2), node-pg-admin still had "pg" version 7.18.2 as transitive dependency. After installing "pg" version 8.9.0 manually, everything works again.

Root cause seemed to lie somewhere in the pg client connecting to pg;

I managed to reproduce the error in a minimal example (with postgres:9.6.3-alpine image as well):

package.json:

{ "name": "test-node-pg-migrate", "version": "1.0.0", "dependencies": { "node-pg-migrate": "6.2.2", "pg": "7.18.2" }, "scripts": { "migrate-up": "node-pg-migrate -f ./pg-migrate-dev.json up", "migrate-down": "node-pg-migrate -f ./pg-migrate-dev.json down" } }

So when using node 16, node-pg-migrate does not seem to work with pg version 7.18.2 (and probably other versions of pg as well). I guess having pg >= 8 as dependency would make sense.

Just tested this and upgrading the pg package to 8.9.0 fixed the issue. Thanks!!

@Shinigami92 Shinigami92 added has workaround Workaround provided or linked s: awaiting more info Additional information are requested s: pending triage Pending Triage labels Mar 8, 2024
@Shinigami92
Copy link
Collaborator

Is this an still an issue? Or did #887 (comment) solved it completely?
Is 7.0.0-alpha.0 maybe working better for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has workaround Workaround provided or linked s: awaiting more info Additional information are requested s: pending triage Pending Triage
Projects
None yet
Development

No branches or pull requests

6 participants