Cloud-Automation / nodeshm

shm_open and shm_unlink interface for node.js
MIT License
1 stars 2 forks source link

Installation failure #1

Open mara004 opened 2 months ago

mara004 commented 2 months ago

@stefanpoeter On Fedora 37 with nodejs 20, npm install nodeshm fails like this:

$ npm install nodeshm
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'nodeshm@0.1.1',
npm WARN EBADENGINE   required: { node: '5.x.x' },
npm WARN EBADENGINE   current: { node: 'v20.8.1', npm: '10.1.0' }
npm WARN EBADENGINE }
npm notice 
npm notice New minor version of npm available! 10.1.0 -> 10.8.3
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.3
npm notice Run npm install -g npm@10.8.3 to update!
npm notice 
npm ERR! code 1
npm ERR! path /home/me/projects/stash/scripts/pdfjs/node_modules/nodeshm
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! make: Entering directory '/home/me/projects/stash/scripts/pdfjs/node_modules/nodeshm/build'
npm ERR!   CXX(target) Release/obj.target/shm/shm.o
npm ERR! make: Leaving directory '/home/me/projects/stash/scripts/pdfjs/node_modules/nodeshm/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.4.0
npm ERR! gyp info using node@20.8.1 | linux | x64
npm ERR! gyp info find Python using Python version 3.11.6 found at "/usr/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v20.8.1/node-v20.8.1-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v20.8.1/node-v20.8.1-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v20.8.1/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v20.8.1/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/lib/node_modules_20/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/me/projects/stash/scripts/pdfjs/node_modules/nodeshm/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/lib/node_modules_20/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/me/.cache/node-gyp/20.8.1/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/me/.cache/node-gyp/20.8.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules_20/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/me/.cache/node-gyp/20.8.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/me/projects/stash/scripts/pdfjs/node_modules/nodeshm',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! ../shm.cpp: In function ‘void unlink(const v8::FunctionCallbackInfo<v8::Value>&)’:
npm ERR! ../shm.cpp:20:40: error: cannot convert ‘v8::MaybeLocal<v8::String>’ to ‘v8::Local<v8::String>’
npm ERR!    20 |                 v8::String::NewFromUtf8(isolate, "shm_unlink() takes 1 arguments: name.")));
npm ERR!       |                 ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR!       |                                        |
npm ERR!       |                                        v8::MaybeLocal<v8::String>
npm ERR! In file included from /home/me/.cache/node-gyp/20.8.1/include/node/v8.h:30,
npm ERR!                  from /home/me/.cache/node-gyp/20.8.1/include/node/node.h:73,
npm ERR!                  from ../shm.cpp:1:
npm ERR! /home/me/.cache/node-gyp/20.8.1/include/node/v8-exception.h:40:43: note:   initializing argument 1 of ‘static v8::Local<v8::Value> v8::Exception::Error(v8::Local<v8::String>)’
npm ERR!    40 |   static Local<Value> Error(Local<String> message);
npm ERR!       |                             ~~~~~~~~~~~~~~^~~~~~~
npm ERR! ../shm.cpp:24:48: error: no matching function for call to ‘v8::Value::ToString()’
npm ERR!    24 |     v8::String::Utf8Value str(args[0]->ToString());
npm ERR!       |                               ~~~~~~~~~~~~~~~~~^~
npm ERR! In file included from /home/me/.cache/node-gyp/20.8.1/include/node/v8-primitive.h:11,
npm ERR!                  from /home/me/.cache/node-gyp/20.8.1/include/node/v8-object.h:11,
npm ERR!                  from /home/me/.cache/node-gyp/20.8.1/include/node/v8-array-buffer.h:13,
npm ERR!                  from /home/me/.cache/node-gyp/20.8.1/include/node/v8.h:24:
npm ERR! /home/me/.cache/node-gyp/20.8.1/include/node/v8-value.h:370:44: note: candidate: ‘v8::MaybeLocal<v8::String> v8::Value::ToString(v8::Local<v8::Context>) const’
npm ERR!   370 |   V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
npm ERR!       |                                            ^~~~~~~~
npm ERR! /home/me/.cache/node-gyp/20.8.1/include/node/v8-value.h:370:44: note:   candidate expects 1 argument, 0 provided
npm ERR! ../shm.cpp: In function ‘void open(const v8::FunctionCallbackInfo<v8::Value>&)’:
npm ERR! ../shm.cpp:44:40: error: cannot convert ‘v8::MaybeLocal<v8::String>’ to ‘v8::Local<v8::String>’
npm ERR!    44 |                 v8::String::NewFromUtf8(isolate, "shm_open() takes 3 arguments: name, oflag and mode.")));
npm ERR!       |                 ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR!       |                                        |
npm ERR!       |                                        v8::MaybeLocal<v8::String>
npm ERR! /home/me/.cache/node-gyp/20.8.1/include/node/v8-exception.h:40:43: note:   initializing argument 1 of ‘static v8::Local<v8::Value> v8::Exception::Error(v8::Local<v8::String>)’
npm ERR!    40 |   static Local<Value> Error(Local<String> message);
npm ERR!       |                             ~~~~~~~~~~~~~~^~~~~~~
npm ERR! ../shm.cpp:48:41: error: no matching function for call to ‘v8::Value::ToInteger()’
npm ERR!    48 |     const int oflag = args[1]->ToInteger()->Value();
npm ERR!       |                       ~~~~~~~~~~~~~~~~~~^~
npm ERR! /home/me/.cache/node-gyp/20.8.1/include/node/v8-value.h:389:45: note: candidate: ‘v8::MaybeLocal<v8::Integer> v8::Value::ToInteger(v8::Local<v8::Context>) const’
npm ERR!   389 |   V8_WARN_UNUSED_RESULT MaybeLocal<Integer> ToInteger(
npm ERR!       |                                             ^~~~~~~~~
npm ERR! /home/me/.cache/node-gyp/20.8.1/include/node/v8-value.h:389:45: note:   candidate expects 1 argument, 0 provided
npm ERR! ../shm.cpp:49:43: error: no matching function for call to ‘v8::Value::ToInteger()’
npm ERR!    49 |     const mode_t mode = args[2]->ToInteger()->Value();
npm ERR!       |                         ~~~~~~~~~~~~~~~~~~^~
npm ERR! /home/me/.cache/node-gyp/20.8.1/include/node/v8-value.h:389:45: note: candidate: ‘v8::MaybeLocal<v8::Integer> v8::Value::ToInteger(v8::Local<v8::Context>) const’
npm ERR!   389 |   V8_WARN_UNUSED_RESULT MaybeLocal<Integer> ToInteger(
npm ERR!       |                                             ^~~~~~~~~
npm ERR! /home/me/.cache/node-gyp/20.8.1/include/node/v8-value.h:389:45: note:   candidate expects 1 argument, 0 provided
npm ERR! ../shm.cpp:51:48: error: no matching function for call to ‘v8::Value::ToString()’
npm ERR!    51 |     v8::String::Utf8Value str(args[0]->ToString());
npm ERR!       |                               ~~~~~~~~~~~~~~~~~^~
npm ERR! /home/me/.cache/node-gyp/20.8.1/include/node/v8-value.h:370:44: note: candidate: ‘v8::MaybeLocal<v8::String> v8::Value::ToString(v8::Local<v8::Context>) const’
npm ERR!   370 |   V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
npm ERR!       |                                            ^~~~~~~~
npm ERR! /home/me/.cache/node-gyp/20.8.1/include/node/v8-value.h:370:44: note:   candidate expects 1 argument, 0 provided
npm ERR! ../shm.cpp: At global scope:
npm ERR! /home/me/.cache/node-gyp/20.8.1/include/node/node.h:1170:7: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>)’ to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
npm ERR!  1170 |       (node::addon_register_func) (regfunc),                          \
npm ERR!       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /home/me/.cache/node-gyp/20.8.1/include/node/node.h:1204:3: note: in expansion of macro ‘NODE_MODULE_X’
npm ERR!  1204 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
npm ERR!       |   ^~~~~~~~~~~~~
npm ERR! ../shm.cpp:73:1: note: in expansion of macro ‘NODE_MODULE’
npm ERR!    73 | NODE_MODULE(mmap, RegisterModule);
npm ERR!       | ^~~~~~~~~~~
npm ERR! make: *** [shm.target.mk:110: Release/obj.target/shm/shm.o] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules_20/npm/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm ERR! gyp ERR! System Linux 6.5.12-100.fc37.x86_64
npm ERR! gyp ERR! command "/usr/bin/node-20" "/usr/lib/node_modules_20/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /home/me/projects/stash/scripts/pdfjs/node_modules/nodeshm
npm ERR! gyp ERR! node -v v20.8.1
npm ERR! gyp ERR! node-gyp -v v9.4.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: /home/me/.npm/_logs/2024-09-09T14_20_27_662Z-debug-0.log

The full log is attached: nodeshm_install.log.txt

stefanpoeter commented 2 months ago
npm WARN EBADENGINE   required: { node: '5.x.x' },
npm WARN EBADENGINE   current: { node: 'v20.8.1', npm: '10.1.0' }

That might be the cause. Could be that the API changed in the meantime.