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

pg-native don't works on Node 23 #3332

Open
cesco69 opened this issue Oct 17, 2024 · 3 comments · May be fixed by brianc/node-libpq#103
Open

pg-native don't works on Node 23 #3332

cesco69 opened this issue Oct 17, 2024 · 3 comments · May be fixed by brianc/node-libpq#103

Comments

@cesco69
Copy link

cesco69 commented Oct 17, 2024

@brianc

Install pg-native fails on Node 23 because pg-native depends on node-libpq that depends on nan 2.19.0.
nan 2.19.0 official support node at version 21 (see https://www.npmjs.com/package/nan/v/2.19.0 ) but also works on node 22, but doesn't works on node 23 due to this issue nodejs/nan#953 fixed on nan 2.22.0 (see https://www.npmjs.com/package/nan/v/2.22.0).

How fix it

Fixing pg-native on node 23 require to update nan dependecies on node-libpq (see this PR brianc/node-libpq#103 ), releasing a new version and update pg-native dependecies of node-libpq.

Workaround

The workaround is override nan peer dependencies into package.json, eg (with pnpm):

{
     "pnpm": {
        "overrides": {
            "nan": "2.22.0"
        }
    }
}

Step to riproduce

Create a Dockerfile file with node 23

FROM node:23-slim

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get -y install git python3 libpq-dev g++ make dos2unix && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*

# install pg-native
RUN npm i -g pg-native

run docker build

docker build

Output

show
docker build
[+] Building 56.4s (7/7) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                         0.0s
 => => transferring dockerfile: 341B                                                                                                                                                                                                                                         0.0s 
 => [internal] load .dockerignore                                                                                                                                                                                                                                            0.0s 
 => => transferring context: 34B                                                                                                                                                                                                                                             0.0s 
 => [internal] load metadata for docker.io/library/node:23-slim                                                                                                                                                                                                              0.7s 
 => CACHED [1/4] FROM docker.io/library/node:23-slim@sha256:70092ae76d3b1a66dc51d659fd8882c42b2d816333c45ca4f2367ff0628e20a4                                                                                                                                                 0.0s
 => [2/4] RUN apt-get update && apt-get -y install git python3 libpq-dev g++ make dos2unix && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*                                                                                                                         35.7s                                                                                                                                                                                                                       0.8s
 => ERROR [3/4] RUN npm i -g pg-native                                                                                                                                                                                                                                      19.2s
------
 > [3/4] RUN npm i -g pg-native:
#0 0.724 (node:7) ExperimentalWarning: Support for loading ES Module in require() is an experimental feature and might change at any time
#0 0.724 (Use `node --trace-warnings ...` to show where the warning was created)
#0 19.18 npm error code 1
#0 19.18 npm error path /usr/local/lib/node_modules/pg-native/node_modules/libpq
#0 19.18 npm error command failed
#0 19.18 npm error command sh -c node-gyp rebuild
#0 19.18 npm error make: Entering directory '/usr/local/lib/node_modules/pg-native/node_modules/libpq/build'
#0 19.18 npm error   CXX(target) Release/obj.target/addon/src/connection.o
#0 19.18 npm error make: Leaving directory '/usr/local/lib/node_modules/pg-native/node_modules/libpq/build'
#0 19.18 npm error gyp info it worked if it ends with ok
#0 19.18 npm error gyp info using [email protected]
#0 19.18 npm error gyp info using [email protected] | linux | x64
#0 19.18 npm error gyp info find Python using Python version 3.11.2 found at "/usr/bin/python3"
#0 19.18 npm error (node:20) ExperimentalWarning: Support for loading ES Module in require() is an experimental feature and might change at any time
#0 19.18 npm error (Use `node --trace-warnings ...` to show where the warning was created)
#0 19.18 npm error gyp http GET https://nodejs.org/download/release/v23.0.0/node-v23.0.0-headers.tar.gz
#0 19.18 npm error gyp http 200 https://nodejs.org/download/release/v23.0.0/node-v23.0.0-headers.tar.gz
#0 19.18 npm error gyp http GET https://nodejs.org/download/release/v23.0.0/SHASUMS256.txt
#0 19.18 npm error gyp http 200 https://nodejs.org/download/release/v23.0.0/SHASUMS256.txt
#0 19.18 npm error gyp info spawn /usr/bin/python3
#0 19.18 npm error gyp info spawn args [
#0 19.18 npm error gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
#0 19.18 npm error gyp info spawn args 'binding.gyp',
#0 19.18 npm error gyp info spawn args '-f',
#0 19.18 npm error gyp info spawn args 'make',
#0 19.18 npm error gyp info spawn args '-I',
#0 19.18 npm error gyp info spawn args '/usr/local/lib/node_modules/pg-native/node_modules/libpq/build/config.gypi',
#0 19.18 npm error gyp info spawn args '-I',
#0 19.18 npm error gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
#0 19.18 npm error gyp info spawn args '-I',
#0 19.18 npm error gyp info spawn args '/root/.cache/node-gyp/23.0.0/include/node/common.gypi',
#0 19.18 npm error gyp info spawn args '-Dlibrary=shared_library',
#0 19.18 npm error gyp info spawn args '-Dvisibility=default',
#0 19.18 npm error gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/23.0.0',
#0 19.18 npm error gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
#0 19.18 npm error gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/23.0.0/<(target_arch)/node.lib',
#0 19.18 npm error gyp info spawn args '-Dmodule_root_dir=/usr/local/lib/node_modules/pg-native/node_modules/libpq',
#0 19.18 npm error gyp info spawn args '-Dnode_engine=v8',
#0 19.18 npm error gyp info spawn args '--depth=.',
#0 19.18 npm error gyp info spawn args '--no-parallel',
#0 19.18 npm error gyp info spawn args '--generator-output',
#0 19.18 npm error gyp info spawn args 'build',
#0 19.18 npm error gyp info spawn args '-Goutput_dir=.'
#0 19.18 npm error gyp info spawn args ]
#0 19.18 npm error gyp info spawn make
#0 19.18 npm error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
#0 19.18 npm error In file included from ../src/addon.h:4,
#0 19.18 npm error                  from ../src/connection.cc:1:
#0 19.18 npm error ../../nan/nan.h:208:40: error: expected template-name before '<' token
#0 19.18 npm error   208 |     public v8::CopyablePersistentTraits<T> {};
#0 19.18 npm error       |                                        ^
#0 19.18 npm error ../../nan/nan.h:208:40: error: expected '{' before '<' token
#0 19.18 npm error ../../nan/nan.h: In function 'bool Nan::IdleNotification(int)':
#0 19.18 npm error ../../nan/nan.h:688:39: error: 'class v8::Isolate' has no member named 'IdleNotificationDeadline'
#0 19.18 npm error   688 |     return v8::Isolate::GetCurrent()->IdleNotificationDeadline(
#0 19.18 npm error       |                                       ^~~~~~~~~~~~~~~~~~~~~~~~
#0 19.18 npm error ../../nan/nan.h: In function 'void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, GetterCallback, SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, imp::Sig)':
#0 19.18 npm error ../../nan/nan.h:2548:8: error: 'class v8::ObjectTemplate' has no member named 'SetAccessor'
#0 19.18 npm error  2548 |   tpl->SetAccessor(
#0 19.18 npm error       |        ^~~~~~~~~~~
#0 19.18 npm error ../../nan/nan.h: In function 'void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, GetterCallback, SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)':
#0 19.18 npm error ../../nan/nan.h:2596:8: error: 'class v8::ObjectTemplate' has no member named 'SetAccessor'
#0 19.18 npm error  2596 |   tpl->SetAccessor(
#0 19.18 npm error       |        ^~~~~~~~~~~
#0 19.18 npm error ../../nan/nan.h: In function 'bool Nan::SetAccessor(v8::Local<v8::Object>, v8::Local<v8::String>, GetterCallback, SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)':
#0 19.18 npm error ../../nan/nan.h:2642:15: error: 'class v8::Object' has no member named 'SetAccessor'
#0 19.18 npm error  2642 |   return obj->SetAccessor(
#0 19.18 npm error       |               ^~~~~~~~~~~
#0 19.18 npm error ../../nan/nan.h: In function 'void Nan::SetNamedPropertyHandler(v8::Local<v8::ObjectTemplate>, PropertyGetterCallback, PropertySetterCallback, PropertyQueryCallback, PropertyDeleterCallback, PropertyEnumeratorCallback, v8::Local<v8::Value>)':
#0 19.18 npm error ../../nan/nan.h:2719:7: error: invalid conversion from 'Nan::imp::NativePropertyGetter' {aka 'void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&)'} to 'v8::NamedPropertyGetterCallback' {aka 'v8::Intercepted (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&)'} [-fpermissive]
#0 19.18 npm error  2719 |       getter_, setter_, query_, deleter_, enumerator_, obj));
#0 19.18 npm error       |       ^~~~~~~
#0 19.18 npm error       |       |
#0 19.18 npm error       |       Nan::imp::NativePropertyGetter {aka void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&)}
#0 19.18 npm error In file included from /root/.cache/node-gyp/23.0.0/include/node/v8-function.h:15,
#0 19.18 npm error                  from /root/.cache/node-gyp/23.0.0/include/node/v8.h:33,
#0 19.18 npm error                  from /root/.cache/node-gyp/23.0.0/include/node/node.h:73,
#0 19.18 npm error                  from ../../nan/nan.h:62:
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-template.h:786:35: note:   initializing argument 1 of 'v8::NamedPropertyHandlerConfiguration::NamedPropertyHandlerConfiguration(v8::NamedPropertyGetterCallback, v8::NamedPropertySetterCallback, v8::NamedPropertyQueryCallback, v8::NamedPropertyDeleterCallback, v8::NamedPropertyEnumeratorCallback, v8::Local<v8::Value>, v8::PropertyHandlerFlags)'
#0 19.18 npm error   786 |       NamedPropertyGetterCallback getter,
#0 19.18 npm error       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
#0 19.18 npm error ../../nan/nan.h:2719:16: error: invalid conversion from 'Nan::imp::NativePropertySetter' {aka 'void (*)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<v8::Value>&)'} to 'v8::NamedPropertySetterCallback' {aka 'v8::Intercepted (*)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&)'} [-fpermissive]
#0 19.18 npm error  2719 |       getter_, setter_, query_, deleter_, enumerator_, obj));
#0 19.18 npm error       |                ^~~~~~~
#0 19.18 npm error       |                |
#0 19.18 npm error       |                Nan::imp::NativePropertySetter {aka void (*)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<v8::Value>&)}
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-template.h:787:35: note:   initializing argument 2 of 'v8::NamedPropertyHandlerConfiguration::NamedPropertyHandlerConfiguration(v8::NamedPropertyGetterCallback, v8::NamedPropertySetterCallback, v8::NamedPropertyQueryCallback, v8::NamedPropertyDeleterCallback, v8::NamedPropertyEnumeratorCallback, v8::Local<v8::Value>, v8::PropertyHandlerFlags)'
#0 19.18 npm error   787 |       NamedPropertySetterCallback setter = nullptr,
#0 19.18 npm error       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
#0 19.18 npm error ../../nan/nan.h:2719:25: error: invalid conversion from 'Nan::imp::NativePropertyQuery' {aka 'void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Integer>&)'} to 'v8::NamedPropertyQueryCallback' {aka 'v8::Intercepted (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Integer>&)'} [-fpermissive]
#0 19.18 npm error  2719 |       getter_, setter_, query_, deleter_, enumerator_, obj));
#0 19.18 npm error       |                         ^~~~~~
#0 19.18 npm error       |                         |
#0 19.18 npm error       |                         Nan::imp::NativePropertyQuery {aka void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Integer>&)}
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-template.h:788:34: note:   initializing argument 3 of 'v8::NamedPropertyHandlerConfiguration::NamedPropertyHandlerConfiguration(v8::NamedPropertyGetterCallback, v8::NamedPropertySetterCallback, v8::NamedPropertyQueryCallback, v8::NamedPropertyDeleterCallback, v8::NamedPropertyEnumeratorCallback, v8::Local<v8::Value>, v8::PropertyHandlerFlags)'
#0 19.18 npm error   788 |       NamedPropertyQueryCallback query = nullptr,
#0 19.18 npm error       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
#0 19.18 npm error ../../nan/nan.h:2719:33: error: invalid conversion from 'void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Boolean>&)' to 'v8::NamedPropertyDeleterCallback' {aka 'v8::Intercepted (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Boolean>&)'} [-fpermissive]
#0 19.18 npm error  2719 |       getter_, setter_, query_, deleter_, enumerator_, obj));
#0 19.18 npm error       |                                 ^~~~~~~~
#0 19.18 npm error       |                                 |
#0 19.18 npm error       |                                 void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Boolean>&)
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-template.h:789:36: note:   initializing argument 4 of 'v8::NamedPropertyHandlerConfiguration::NamedPropertyHandlerConfiguration(v8::NamedPropertyGetterCallback, v8::NamedPropertySetterCallback, v8::NamedPropertyQueryCallback, v8::NamedPropertyDeleterCallback, v8::NamedPropertyEnumeratorCallback, v8::Local<v8::Value>, v8::PropertyHandlerFlags)'
#0 19.18 npm error   789 |       NamedPropertyDeleterCallback deleter = nullptr,
#0 19.18 npm error       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
#0 19.18 npm error ../../nan/nan.h: In function 'void Nan::SetIndexedPropertyHandler(v8::Local<v8::ObjectTemplate>, IndexGetterCallback, IndexSetterCallback, IndexQueryCallback, IndexDeleterCallback, IndexEnumeratorCallback, v8::Local<v8::Value>)':
#0 19.18 npm error ../../nan/nan.h:2789:7: error: invalid conversion from 'Nan::imp::NativeIndexGetter' {aka 'void (*)(unsigned int, const v8::PropertyCallbackInfo<v8::Value>&)'} to 'v8::IndexedPropertyGetterCallbackV2' {aka 'v8::Intercepted (*)(unsigned int, const v8::PropertyCallbackInfo<v8::Value>&)'} [-fpermissive]
#0 19.18 npm error  2789 |       getter_, setter_, query_, deleter_, enumerator_, obj));
#0 19.18 npm error       |       ^~~~~~~
#0 19.18 npm error       |       |
#0 19.18 npm error       |       Nan::imp::NativeIndexGetter {aka void (*)(unsigned int, const v8::PropertyCallbackInfo<v8::Value>&)}
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-template.h:865:39: note:   initializing argument 1 of 'v8::IndexedPropertyHandlerConfiguration::IndexedPropertyHandlerConfiguration(v8::IndexedPropertyGetterCallbackV2, v8::IndexedPropertySetterCallbackV2, v8::IndexedPropertyQueryCallbackV2, v8::IndexedPropertyDeleterCallbackV2, v8::IndexedPropertyEnumeratorCallback, v8::Local<v8::Value>, v8::PropertyHandlerFlags)'
#0 19.18 npm error   865 |       IndexedPropertyGetterCallbackV2 getter = nullptr,
#0 19.18 npm error       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
#0 19.18 npm error ../../nan/nan.h:2789:16: error: invalid conversion from 'Nan::imp::NativeIndexSetter' {aka 'void (*)(unsigned int, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<v8::Value>&)'} to 'v8::IndexedPropertySetterCallbackV2' {aka 'v8::Intercepted (*)(unsigned int, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&)'} [-fpermissive]
#0 19.18 npm error  2789 |       getter_, setter_, query_, deleter_, enumerator_, obj));
#0 19.18 npm error       |                ^~~~~~~
#0 19.18 npm error       |                |
#0 19.18 npm error       |                Nan::imp::NativeIndexSetter {aka void (*)(unsigned int, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<v8::Value>&)}
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-template.h:866:39: note:   initializing argument 2 of 'v8::IndexedPropertyHandlerConfiguration::IndexedPropertyHandlerConfiguration(v8::IndexedPropertyGetterCallbackV2, v8::IndexedPropertySetterCallbackV2, v8::IndexedPropertyQueryCallbackV2, v8::IndexedPropertyDeleterCallbackV2, v8::IndexedPropertyEnumeratorCallback, v8::Local<v8::Value>, v8::PropertyHandlerFlags)'
#0 19.18 npm error   866 |       IndexedPropertySetterCallbackV2 setter = nullptr,
#0 19.18 npm error       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
#0 19.18 npm error ../../nan/nan.h:2789:25: error: invalid conversion from 'Nan::imp::NativeIndexQuery' {aka 'void (*)(unsigned int, const v8::PropertyCallbackInfo<v8::Integer>&)'} to 'v8::IndexedPropertyQueryCallbackV2' {aka 'v8::Intercepted (*)(unsigned int, const v8::PropertyCallbackInfo<v8::Integer>&)'} [-fpermissive]
#0 19.18 npm error  2789 |       getter_, setter_, query_, deleter_, enumerator_, obj));
#0 19.18 npm error       |                         ^~~~~~
#0 19.18 npm error       |                         |
#0 19.18 npm error       |                         Nan::imp::NativeIndexQuery {aka void (*)(unsigned int, const v8::PropertyCallbackInfo<v8::Integer>&)}
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-template.h:867:38: note:   initializing argument 3 of 'v8::IndexedPropertyHandlerConfiguration::IndexedPropertyHandlerConfiguration(v8::IndexedPropertyGetterCallbackV2, v8::IndexedPropertySetterCallbackV2, v8::IndexedPropertyQueryCallbackV2, v8::IndexedPropertyDeleterCallbackV2, v8::IndexedPropertyEnumeratorCallback, v8::Local<v8::Value>, v8::PropertyHandlerFlags)'
#0 19.18 npm error   867 |       IndexedPropertyQueryCallbackV2 query = nullptr,
#0 19.18 npm error       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
#0 19.18 npm error ../../nan/nan.h:2789:33: error: invalid conversion from 'Nan::imp::NativeIndexDeleter' {aka 'void (*)(unsigned int, const v8::PropertyCallbackInfo<v8::Boolean>&)'} to 'v8::IndexedPropertyDeleterCallbackV2' {aka 'v8::Intercepted (*)(unsigned int, const v8::PropertyCallbackInfo<v8::Boolean>&)'} [-fpermissive]
#0 19.18 npm error  2789 |       getter_, setter_, query_, deleter_, enumerator_, obj));
#0 19.18 npm error       |                                 ^~~~~~~~
#0 19.18 npm error       |                                 |
#0 19.18 npm error       |                                 Nan::imp::NativeIndexDeleter {aka void (*)(unsigned int, const v8::PropertyCallbackInfo<v8::Boolean>&)}
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-template.h:868:40: note:   initializing argument 4 of 'v8::IndexedPropertyHandlerConfiguration::IndexedPropertyHandlerConfiguration(v8::IndexedPropertyGetterCallbackV2, v8::IndexedPropertySetterCallbackV2, v8::IndexedPropertyQueryCallbackV2, v8::IndexedPropertyDeleterCallbackV2, v8::IndexedPropertyEnumeratorCallback, v8::Local<v8::Value>, v8::PropertyHandlerFlags)'
#0 19.18 npm error   868 |       IndexedPropertyDeleterCallbackV2 deleter = nullptr,
#0 19.18 npm error       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
#0 19.18 npm error In file included from ../../nan/nan.h:2954:
#0 19.18 npm error ../../nan/nan_scriptorigin.h: In constructor 'Nan::ScriptOrigin::ScriptOrigin(v8::Local<v8::Value>)':
#0 19.18 npm error ../../nan/nan_scriptorigin.h:19:55: error: no matching function for call to 'v8::ScriptOrigin::ScriptOrigin(v8::Isolate*, v8::Local<v8::Value>&)'
#0 19.18 npm error    19 |       v8::ScriptOrigin(v8::Isolate::GetCurrent(), name) {}
#0 19.18 npm error       |                                                       ^
#0 19.18 npm error In file included from /root/.cache/node-gyp/23.0.0/include/node/v8-script.h:20,
#0 19.18 npm error                  from /root/.cache/node-gyp/23.0.0/include/node/v8-debug.h:10,
#0 19.18 npm error                  from /root/.cache/node-gyp/23.0.0/include/node/v8-isolate.h:19,
#0 19.18 npm error                  from /root/.cache/node-gyp/23.0.0/include/node/v8-snapshot.h:9,
#0 19.18 npm error                  from /root/.cache/node-gyp/23.0.0/include/node/v8-context.h:15,
#0 19.18 npm error                  from /root/.cache/node-gyp/23.0.0/include/node/v8.h:26:
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-message.h:64:13: note: candidate: 'v8::ScriptOrigin::ScriptOrigin(v8::Local<v8::Value>, int, int, bool, int, v8::Local<v8::Value>, bool, bool, bool, v8::Local<v8::Data>)'
#0 19.18 npm error    64 |   V8_INLINE ScriptOrigin(Local<Value> resource_name,
#0 19.18 npm error       |             ^~~~~~~~~~~~
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-message.h:64:39: note:   no known conversion for argument 1 from 'v8::Isolate*' to 'v8::Local<v8::Value>'
#0 19.18 npm error    64 |   V8_INLINE ScriptOrigin(Local<Value> resource_name,
#0 19.18 npm error       |                          ~~~~~~~~~~~~~^~~~~~~~~~~~~
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-message.h:62:17: note: candidate: 'constexpr v8::ScriptOrigin::ScriptOrigin(const v8::ScriptOrigin&)'
#0 19.18 npm error    62 | class V8_EXPORT ScriptOrigin {
#0 19.18 npm error       |                 ^~~~~~~~~~~~
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-message.h:62:17: note:   candidate expects 1 argument, 2 provided
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-message.h:62:17: note: candidate: 'constexpr v8::ScriptOrigin::ScriptOrigin(v8::ScriptOrigin&&)'
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-message.h:62:17: note:   candidate expects 1 argument, 2 provided
#0 19.18 npm error ../../nan/nan_scriptorigin.h: In constructor 'Nan::ScriptOrigin::ScriptOrigin(v8::Local<v8::Value>, v8::Local<v8::Integer>)':
#0 19.18 npm error ../../nan/nan_scriptorigin.h:25:52: error: no matching function for call to 'v8::ScriptOrigin::ScriptOrigin(v8::Isolate*, v8::Local<v8::Value>&, int)'
#0 19.18 npm error    25 |                    , To<int32_t>(line).FromMaybe(0)) {}
#0 19.18 npm error       |                                                    ^
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-message.h:64:13: note: candidate: 'v8::ScriptOrigin::ScriptOrigin(v8::Local<v8::Value>, int, int, bool, int, v8::Local<v8::Value>, bool, bool, bool, v8::Local<v8::Data>)'
#0 19.18 npm error    64 |   V8_INLINE ScriptOrigin(Local<Value> resource_name,
#0 19.18 npm error       |             ^~~~~~~~~~~~
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-message.h:64:39: note:   no known conversion for argument 1 from 'v8::Isolate*' to 'v8::Local<v8::Value>'
#0 19.18 npm error    64 |   V8_INLINE ScriptOrigin(Local<Value> resource_name,
#0 19.18 npm error       |                          ~~~~~~~~~~~~~^~~~~~~~~~~~~
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-message.h:62:17: note: candidate: 'constexpr v8::ScriptOrigin::ScriptOrigin(const v8::ScriptOrigin&)'
#0 19.18 npm error    62 | class V8_EXPORT ScriptOrigin {
#0 19.18 npm error       |                 ^~~~~~~~~~~~
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-message.h:62:17: note:   candidate expects 1 argument, 3 provided
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-message.h:62:17: note: candidate: 'constexpr v8::ScriptOrigin::ScriptOrigin(v8::ScriptOrigin&&)'
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-message.h:62:17: note:   candidate expects 1 argument, 3 provided
#0 19.18 npm error ../../nan/nan_scriptorigin.h: In constructor 'Nan::ScriptOrigin::ScriptOrigin(v8::Local<v8::Value>, v8::Local<v8::Integer>, v8::Local<v8::Integer>)':
#0 19.18 npm error ../../nan/nan_scriptorigin.h:33:54: error: no matching function for call to 'v8::ScriptOrigin::ScriptOrigin(v8::Isolate*, v8::Local<v8::Value>&, int, int)'
#0 19.18 npm error    33 |                    , To<int32_t>(column).FromMaybe(0)) {}
#0 19.18 npm error       |                                                      ^
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-message.h:64:13: note: candidate: 'v8::ScriptOrigin::ScriptOrigin(v8::Local<v8::Value>, int, int, bool, int, v8::Local<v8::Value>, bool, bool, bool, v8::Local<v8::Data>)'
#0 19.18 npm error    64 |   V8_INLINE ScriptOrigin(Local<Value> resource_name,
#0 19.18 npm error       |             ^~~~~~~~~~~~
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-message.h:64:39: note:   no known conversion for argument 1 from 'v8::Isolate*' to 'v8::Local<v8::Value>'
#0 19.18 npm error    64 |   V8_INLINE ScriptOrigin(Local<Value> resource_name,
#0 19.18 npm error       |                          ~~~~~~~~~~~~~^~~~~~~~~~~~~
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-message.h:62:17: note: candidate: 'constexpr v8::ScriptOrigin::ScriptOrigin(const v8::ScriptOrigin&)'
#0 19.18 npm error    62 | class V8_EXPORT ScriptOrigin {
#0 19.18 npm error       |                 ^~~~~~~~~~~~
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-message.h:62:17: note:   candidate expects 1 argument, 4 provided
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-message.h:62:17: note: candidate: 'constexpr v8::ScriptOrigin::ScriptOrigin(v8::ScriptOrigin&&)'
#0 19.18 npm error /root/.cache/node-gyp/23.0.0/include/node/v8-message.h:62:17: note:   candidate expects 1 argument, 4 provided
#0 19.18 npm error make: *** [addon.target.mk:116: Release/obj.target/addon/src/connection.o] Error 1
#0 19.18 npm error gyp ERR! build error
#0 19.18 npm error gyp ERR! stack Error: `make` failed with exit code: 2
#0 19.18 npm error gyp ERR! stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:216:23)
#0 19.18 npm error gyp ERR! System Linux 5.15.79.1-microsoft-standard-WSL2
#0 19.18 npm error gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
#0 19.18 npm error gyp ERR! cwd /usr/local/lib/node_modules/pg-native/node_modules/libpq
#0 19.18 npm error gyp ERR! node -v v23.0.0
#0 19.18 npm error gyp ERR! node-gyp -v v10.2.0
#0 19.18 npm error gyp ERR! not ok
#0 19.18 npm error A complete log of this run can be found in: /root/.npm/_logs/2024-10-17T10_05_04_262Z-debug-0.log
------
failed to solve: executor failed running [/bin/sh -c npm i -g pg-native]: exit code: 1

I have also add node 23 into the matrix test #3337 that actually fails for this reason (see https://github.com/brianc/node-postgres/actions/runs/11608539697/job/32326937373?pr=3337 )

@cesco69

This comment was marked as off-topic.

@cclauss
Copy link

cclauss commented Oct 18, 2024

Given that "/rc/" is not found in the output above, this is a different problem than nodejs/node-gyp#3082

@cesco69 cesco69 closed this as completed Oct 18, 2024
@cesco69 cesco69 reopened this Oct 30, 2024
@cesco69 cesco69 linked a pull request Oct 30, 2024 that will close this issue
@cesco69 cesco69 changed the title install pg-native fails on Node 23 pg-native don't works on Node 23 Oct 31, 2024
@cesco69
Copy link
Author

cesco69 commented Nov 25, 2024

@charmander @brianc any news? this issue has a fix brianc/node-libpq#103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants