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

The project depends on packages that cannot be built with recent Node.js versions (v18+ or v20+) #679

Open
remyroy opened this issue Feb 14, 2024 · 0 comments

Comments

@remyroy
Copy link
Contributor

remyroy commented Feb 14, 2024

You still need to use a Node.js version lower than v18 to install and build the project dependencies. The previous LTS release v16+ support ended a few months ago.

Update the project dependencies to support installing and building the dependencies and the project with recent Node.js versions that are still supported like v18+ and v20+.

Here is the output of calling yarn install with Node.js v20.11.1:

$ yarn install
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "@rescripts/rescript-env > @rescripts/rescript-use-tslint-config > [email protected]" has unmet peer dependency "tslint@>=4.0.0".
warning " > [email protected]" has incorrect peer dependency "eslint@^7.0.0".
warning " > [email protected]" has unmet peer dependency "classnames@^2.2.5".
warning " > [email protected]" has unmet peer dependency "react-is@>= 16.8.0".
warning "@formatjs/cli > @vue/[email protected]" has unmet peer dependency "[email protected]".
warning " > @testing-library/[email protected]" has unmet peer dependency "@testing-library/dom@>=5".
warning " > [email protected]" has unmet peer dependency "tslint@^5.0.0 || ^6.0.0".
[4/4] Building fresh packages...
[1/18] ⠐ bcrypto
[-/18] ⠈ waiting...
[7/18] ⠈ keccak
[8/18] ⠈ sha3
error /home/remyroy/Projects/staking-launchpad/node_modules/sha3: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /home/remyroy/Projects/staking-launchpad/node_modules/sha3
Output:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info find Python using Python version 3.10.12 found at "/usr/bin/python3"
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args   '/home/remyroy/.config/yarn/global/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/remyroy/Projects/staking-launchpad/node_modules/sha3/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/remyroy/.config/yarn/global/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/remyroy/.cache/node-gyp/20.11.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/remyroy/.cache/node-gyp/20.11.1',
gyp info spawn args   '-Dnode_gyp_dir=/home/remyroy/.config/yarn/global/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/remyroy/.cache/node-gyp/20.11.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/remyroy/Projects/staking-launchpad/node_modules/sha3',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/remyroy/Projects/staking-launchpad/node_modules/sha3/build'
  CXX(target) Release/obj.target/sha3/src/addon.o
In file included from ../node_modules/nan/nan.h:173,
                 from ../src/addon.cpp:4:
../node_modules/nan/nan_callbacks.h:55:23: error: ‘AccessorSignature’ is not a member of ‘v8’
   55 | typedef v8::Local<v8::AccessorSignature> Sig;
      |                       ^~~~~~~~~~~~~~~~~
../node_modules/nan/nan_callbacks.h:55:40: error: template argument 1 is invalid
   55 | typedef v8::Local<v8::AccessorSignature> Sig;
      |                                        ^
In file included from ../src/addon.cpp:4:
../node_modules/nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../node_modules/nan/nan.h:2232:7: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2232 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, Nan::imp::Sig)’:
../node_modules/nan/nan.h:2470: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&)’
 2470 |   tpl->SetAccessor(
      |   ~~~~~~~~~~~~~~~~^
 2471 |       name
      |       ~~~~         
 2472 |     , getter_
      |     ~~~~~~~~~      
 2473 |     , setter_
      |     ~~~~~~~~~      
 2474 |     , obj
      |     ~~~~~          
 2475 |     , settings
      |     ~~~~~~~~~~     
 2476 |     , attribute
      |     ~~~~~~~~~~~    
 2477 |     , signature);
      |     ~~~~~~~~~~~~   
In file included from /home/remyroy/.cache/node-gyp/20.11.1/include/node/v8-function.h:15,
                 from /home/remyroy/.cache/node-gyp/20.11.1/include/node/v8.h:33,
                 from /home/remyroy/.cache/node-gyp/20.11.1/include/node/node.h:73,
                 from ../src/addon.cpp:1:
/home/remyroy/.cache/node-gyp/20.11.1/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)’
  809 |   void SetAccessor(
      |        ^~~~~~~~~~~
/home/remyroy/.cache/node-gyp/20.11.1/include/node/v8-template.h:814:22: note:   no known conversion for argument 7 from ‘Nan::imp::Sig’ {aka ‘int’} to ‘v8::SideEffectType’
  814 |       SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
      |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/remyroy/.cache/node-gyp/20.11.1/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)’
  816 |   void SetAccessor(
      |        ^~~~~~~~~~~
/home/remyroy/.cache/node-gyp/20.11.1/include/node/v8-template.h:821:22: note:   no known conversion for argument 7 from ‘Nan::imp::Sig’ {aka ‘int’} to ‘v8::SideEffectType’
  821 |       SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
      |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../node_modules/nan/nan.h:2818,
                 from ../src/addon.cpp:4:
../node_modules/nan/nan_typedarray_contents.h: In constructor ‘Nan::TypedArrayContents<T>::TypedArrayContents(v8::Local<v8::Value>)’:
../node_modules/nan/nan_typedarray_contents.h:34:43: error: ‘class v8::ArrayBuffer’ has no member named ‘GetContents’
   34 |       data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
      |                                           ^~~~~~~~~~~
In file included from ../src/addon.cpp:1:
../src/addon.cpp: At global scope:
/home/remyroy/.cache/node-gyp/20.11.1/include/node/node.h:1172:7: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
 1172 |       (node::addon_register_func) (regfunc),                          \
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/remyroy/.cache/node-gyp/20.11.1/include/node/node.h:1206:3: note: in expansion of macro ‘NODE_MODULE_X’
 1206 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../src/addon.cpp:175:1: note: in expansion of macro ‘NODE_MODULE’
  175 | NODE_MODULE(sha3, SHA3Hash::Init)
      | ^~~~~~~~~~~
make: *** [sha3.target.mk:112: Release/obj.target/sha3/src/addon.o] Error 1
make: Leaving directory '/home/remyroy/Projects/staking-launchpad/node_modules/sha3/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/remyroy/.config/yarn/global/node_modules/node-gyp/lib/build.js:203:23)
gyp ERR! stack     at ChildProcess.emit (node:events:518:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
gyp ERR! System Linux 6.5.0-17-generic
gyp ERR! command "/usr/bin/node" "/home/remyroy/.yarn/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/remyroy/Projects/staking-launchpad/node_modules/sha3
gyp ERR! node -v v20.11.1

Installing and building the project dependencies with Node.js v16.20.2 still work.

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

No branches or pull requests

1 participant