Repository navigation
Closed
Description
Hi,
I am trying to upgrade to node 20 (from 16) and I see this compilation error:
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../../nan/nan.h:178,
npm ERR! from ../bindings/profiler.cc:19:
npm ERR! ../../nan/nan_callbacks.h:55:23: error: 'AccessorSignature' is not a member of 'v8'
npm ERR! 55 | typedef v8::Local<v8::AccessorSignature> Sig;
npm ERR! | ^~~~~~~~~~~~~~~~~
npm ERR! ../../nan/nan_callbacks.h:55:40: error: template argument 1 is invalid
npm ERR! 55 | typedef v8::Local<v8::AccessorSignature> Sig;
npm ERR! | ^
npm ERR! ../../nan/nan.h: In function 'bool Nan::IdleNotification(int)':
npm ERR! ../../nan/nan.h:684:63: warning: 'bool v8::Isolate::IdleNotificationDeadline(double)' is deprecated: Use MemoryPressureNotification() to influence the GC schedule. [-Wdeprecated-declarations]
npm ERR! 684 | return v8::Isolate::GetCurrent()->IdleNotificationDeadline(
npm ERR! | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
npm ERR! 685 | idle_time_in_ms * 0.001);
npm ERR! | ~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! In file included from /home/node/.cache/node-gyp/20.10.0/include/node/v8-initialization.h:13,
npm ERR! from /home/node/.cache/node-gyp/20.10.0/include/node/v8.h:34,
npm ERR! from /home/node/.cache/node-gyp/20.10.0/include/node/node.h:73,
npm ERR! from ../../nan/nan.h:58:
npm ERR! /home/node/.cache/node-gyp/20.10.0/include/node/v8-isolate.h:1293:8: note: declared here
npm ERR! 1293 | bool IdleNotificationDeadline(double deadline_in_seconds);
npm ERR! | ^~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../../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)':
npm ERR! ../../nan/nan.h:2544:19: error: no matching function for call to 'v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>&, void (*&)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&), void (*&)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&), v8::Local<v8::Object>&, v8::AccessControl&, v8::PropertyAttribute&, Nan::imp::Sig&)'
npm ERR! 2544 | tpl->SetAccessor(
npm ERR! | ~~~~~~~~~~~~~~~~^
npm ERR! 2545 | name
npm ERR! | ~~~~
npm ERR! 2546 | , getter_
npm ERR! | ~~~~~~~~~
npm ERR! 2547 | , setter_
npm ERR! | ~~~~~~~~~
npm ERR! 2548 | , obj
npm ERR! | ~~~~~
npm ERR! 2549 | , settings
npm ERR! | ~~~~~~~~~~
npm ERR! 2550 | , attribute
npm ERR! | ~~~~~~~~~~~
npm ERR! 2551 | , signature);
npm ERR! | ~~~~~~~~~~~~
npm ERR! In file included from /home/node/.cache/node-gyp/20.10.0/include/node/v8-function.h:15,
npm ERR! from /home/node/.cache/node-gyp/20.10.0/include/node/v8.h:33:
npm ERR! /home/node/.cache/node-gyp/20.10.0/include/node/v8-template.h:809:8: note: candidate: 'void v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)'
npm ERR! 809 | void SetAccessor(
npm ERR! | ^~~~~~~~~~~
npm ERR! /home/node/.cache/node-gyp/20.10.0/include/node/v8-template.h:814:22: note: no known conversion for argument 7 from 'Nan::imp::Sig' {aka 'int'} to 'v8::SideEffectType'
npm ERR! 814 | SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
npm ERR! | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /home/node/.cache/node-gyp/20.10.0/include/node/v8-template.h:816:8: note: candidate: 'void v8::ObjectTemplate::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)'
npm ERR! 816 | void SetAccessor(
npm ERR! | ^~~~~~~~~~~
npm ERR! /home/node/.cache/node-gyp/20.10.0/include/node/v8-template.h:821:22: note: no known conversion for argument 7 from 'Nan::imp::Sig' {aka 'int'} to 'v8::SideEffectType'
npm ERR! 821 | SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
npm ERR! | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! make: *** [pprof.target.mk:115: Release/obj.target/pprof/bindings/profiler.o] Error 1
npm ERR! gyp ERR! build error
This issue looks like it's fixed in nan 2.17.0 - https://github.com/nodejs/nan/blob/main/CHANGELOG.md#2170-oct-10-2022
Is it possible to upgrade this dependency?
Reacted by Omer Levi and Raz Luvaton
Metadata
Metadata
Assignees
Labels
No labels
Activity
aabmass commentedon Dec 5, 2023
Thanks for flagging this. It's actually fixed on main, we just need a release.
yosiat commentedon Dec 7, 2023
Thanks @aabmass , I saw it was released as
3.3.0which is deprecated release.aabmass commentedon Dec 13, 2023
Yes, I deprecated that one. IIRC it contained accidental breaking changes which should have been a major bump. I made a patch release instead to fix it
yosiat commentedon Jan 28, 2024
hey @aabmass is there any update on this one?
we are blocked on node 18 because of this, and the fix should be simple (unless I am missing something) - change nan from 2.14.0 to 2.17.0
aabmass commentedon Jan 31, 2024
@yosiat I'm working on a release right now. However, after checking what was published in pprof@3.2.1, I notice the version of nan has a carat dependency:
pprof-nodejs/package.json
Line 35 in d42aaa3
IOW, you should be able to install it in Node 20 today. You might have an older version of nan in your
package-lock.json. Please try upgrading nan–I tested it in a fresh repo and it works.yosiat commentedon Feb 1, 2024
@aabmass I agree with you that carat should work here, but it doesn't work as expected in my project.
It keeps installing nan
v2.15.0(and there is no other module depending on it except pprof), the only trick that worked isnpm install nanand thennpm uninstall nan, which is a bit weird one.aabmass commentedon Feb 2, 2024
@yosiat I'm guessing it was probably stale from either your
package-lock.jsonor innode_modulesdirectoryaabmass commentedon Feb 2, 2024
Just published v4.0.0
yosiat commentedon Feb 3, 2024
Thanks a lot!