botgram / shell-bot

:robot: Telegram bot that executes commands and sends the live output
GNU General Public License v3.0
787 stars 493 forks source link

[Issue] NPM won't install botgram #62

Closed 0n1cOn3 closed 1 year ago

0n1cOn3 commented 1 year ago

During some installations on Debian systems, where it works awesome, I getting for fedora the following issue:

npm install npm WARN old lockfile npm WARN old lockfile The package-lock.json file was created with an old version of npm, npm WARN old lockfile so supplemental metadata must be fetched from the registry. npm WARN old lockfile npm WARN old lockfile This is a one-time fix-up, please be patient... npm WARN old lockfile npm notice npm notice New minor version of npm available! 9.5.0 -> 9.6.2 npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.6.2 npm notice Run npm install -g npm@9.6.2 to update! npm notice npm ERR! code 1 npm ERR! path /home/stress/shell-bot/node_modules/node-pty npm ERR! command failed npm ERR! command sh -c node scripts/install.js npm ERR! make: Entering directory '/home/stress/shell-bot/node_modules/node-pty/build' npm ERR! CXX(target) Release/obj.target/pty/src/unix/pty.o npm ERR! make: Leaving directory '/home/stress/shell-bot/node_modules/node-pty/build' npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.3.1 npm ERR! gyp info using node@18.15.0 | linux | x64 npm ERR! gyp info find Python using Python version 3.11.2 found at "/usr/bin/python3" npm ERR! gyp http GET https://nodejs.org/download/release/v18.15.0/node-v18.15.0-headers.tar.gz npm ERR! gyp http 200 https://nodejs.org/download/release/v18.15.0/node-v18.15.0-headers.tar.gz npm ERR! gyp http GET https://nodejs.org/download/release/v18.15.0/SHASUMS256.txt npm ERR! gyp http 200 https://nodejs.org/download/release/v18.15.0/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_18/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/stress/shell-bot/node_modules/node-pty/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/usr/lib/node_modules_18/npm/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/stress/.cache/node-gyp/18.15.0/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/stress/.cache/node-gyp/18.15.0', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules_18/npm/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/home/stress/.cache/node-gyp/18.15.0/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/stress/shell-bot/node_modules/node-pty', 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! In file included from ../src/unix/pty.cc:20: npm ERR! ../node_modules/nan/nan.h: In function ‘void Nan::AsyncQueueWorker(AsyncWorker)’: npm ERR! ../node_modules/nan/nan.h:2298: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] npm ERR! 2298 | , reinterpret_cast(AsyncExecuteComplete) npm ERR! | ^~~~~~~~~~~~ npm ERR! ../node_modules/nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local, v8::Local, GetterCallback, SetterCallback, v8::Local, v8::AccessControl, v8::PropertyAttribute, imp::Sig)’: npm ERR! ../nodemodules/nan/nan.h:2536:19: warning: ‘void v8::ObjectTemplate::SetAccessor(v8::Local, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local, v8::AccessControl, v8::PropertyAttribute, v8::Local, v8::SideEffectType, v8::SideEffectType)’ is deprecated: Do signature check in accessor [-Wdeprecated-declarations] npm ERR! 2536 | tpl->SetAccessor( npm ERR! | ~~~~^ npm ERR! 2537 | name npm ERR! | ~~~~ npm ERR! 2538 | , getter npm ERR! | ~~~~~ npm ERR! 2539 | , setter_ npm ERR! | ~~~~~ npm ERR! 2540 | , obj npm ERR! | ~ npm ERR! 2541 | , settings npm ERR! | ~~ npm ERR! 2542 | , attribute npm ERR! | ~~~ npm ERR! 2543 | , signature); npm ERR! | ~~~~ npm ERR! In file included from /home/stress/.cache/node-gyp/18.15.0/include/node/v8-function.h:15, npm ERR! from /home/stress/.cache/node-gyp/18.15.0/include/node/v8.h:33, npm ERR! from /home/stress/.cache/node-gyp/18.15.0/include/node/node.h:73, npm ERR! from ../node_modules/nan/nan.h:54: npm ERR! /home/stress/.cache/node-gyp/18.15.0/include/node/v8-template.h:838:8: note: declared here npm ERR! 838 | void SetAccessor( npm ERR! | ^~~ npm ERR! In file included from ../node_modules/nan/nan.h:2884: npm ERR! ../node_modules/nan/nan_typedarray_contents.h: In constructor ‘Nan::TypedArrayContents::TypedArrayContents(v8::Local)’: npm ERR! ../node_modules/nan/nan_typedarray_contents.h:34:43: error: ‘class v8::ArrayBuffer’ has no member named ‘GetContents’ npm ERR! 34 | data = static_cast<char>(buffer->GetContents().Data()) + byte_offset; npm ERR! | ^~~ npm ERR! ../src/unix/pty.cc: In function ‘void pty_after_waitpid(uv_async_t)’: npm ERR! ../src/unix/pty.cc:486:9: warning: ‘void memset(void, int, size_t)’ writing to an object of type ‘class Nan::Persistent’ with no trivial copy-assignment [-Wclass-memaccess] npm ERR! 486 | memset(&baton->cb, -1, sizeof(baton->cb)); npm ERR! | ~~^~~~~~~~~~~ npm ERR! In file included from ../node_modules/nan/nan.h:403: npm ERR! ../node_modules/nan/nan_persistent_12_inl.h:12:40: note: ‘class Nan::Persistent’ declared here npm ERR! 12 | template<typename T, typename M> class Persistent : npm ERR! | ^~~~~~ npm ERR! ../src/unix/pty.cc: At global scope: npm ERR! /home/stress/.cache/node-gyp/18.15.0/include/node/node.h:978:7: warning: cast between incompatible function types from ‘void ()(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void ()(v8::Local)’} to ‘node::addon_register_func’ {aka ‘void ()(v8::Local, v8::Local, void*)’} [-Wcast-function-type] npm ERR! 978 | (node::addon_register_func) (regfunc), \ npm ERR! | ^~~~~~~~~ npm ERR! /home/stress/.cache/node-gyp/18.15.0/include/node/node.h:1012:3: note: in expansion of macro ‘NODE_MODULE_X’ npm ERR! 1012 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage) npm ERR! | ^~~~~ npm ERR! ../src/unix/pty.cc:708:1: note: in expansion of macro ‘NODE_MODULE’ npm ERR! 708 | NODE_MODULE(pty, init) npm ERR! | ^~~ npm ERR! make: *** [pty.target.mk:112: Release/obj.target/pty/src/unix/pty.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_18/npm/node_modules/node-gyp/lib/build.js:203:23) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28) npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12) npm ERR! gyp ERR! System Linux 6.2.7-200.fc37.x86_64 npm ERR! gyp ERR! command "/usr/bin/node-18" "/usr/lib/node_modules_18/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd /home/stress/shell-bot/node_modules/node-pty npm ERR! gyp ERR! node -v v18.15.0 npm ERR! gyp ERR! node-gyp -v v9.3.1 npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: npm ERR! /home/stress/.npm/_logs/2023-03-27T14_42_18_150Z-debug-0.log

Here the verbose debug log:

222 verbose stack Error: command failed 222 verbose stack at ChildProcess. (/usr/lib/node_modules_18/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27) 222 verbose stack at ChildProcess.emit (node:events:513:28) 222 verbose stack at maybeClose (node:internal/child_process:1091:16) 222 verbose stack at ChildProcess._handle.onexit (node:internal/child_process:302:5) 223 verbose pkgid node-pty@0.9.0 224 verbose cwd /home/stress/shell-bot 225 verbose Linux 6.2.7-200.fc37.x86_64 226 verbose node v18.15.0 227 verbose npm v9.5.0 228 error code 1 229 error path /home/stress/shell-bot/node_modules/node-pty 230 error command failed 231 error command sh -c node scripts/install.js 232 error make: Entering directory '/home/stress/shell-bot/node_modules/node-pty/build' 232 error CXX(target) Release/obj.target/pty/src/unix/pty.o 232 error make: Leaving directory '/home/stress/shell-bot/node_modules/node-pty/build' 233 error gyp info it worked if it ends with ok 233 error gyp info using node-gyp@9.3.1 233 error gyp info using node@18.15.0 | linux | x64 233 error gyp info find Python using Python version 3.11.2 found at "/usr/bin/python3" 233 error gyp http GET https://nodejs.org/download/release/v18.15.0/node-v18.15.0-headers.tar.gz 233 error gyp http 200 https://nodejs.org/download/release/v18.15.0/node-v18.15.0-headers.tar.gz 233 error gyp http GET https://nodejs.org/download/release/v18.15.0/SHASUMS256.txt 233 error gyp http 200 https://nodejs.org/download/release/v18.15.0/SHASUMS256.txt 233 error gyp info spawn /usr/bin/python3 233 error gyp info spawn args [ 233 error gyp info spawn args '/usr/lib/node_modules_18/npm/node_modules/node-gyp/gyp/gyp_main.py', 233 error gyp info spawn args 'binding.gyp', 233 error gyp info spawn args '-f', 233 error gyp info spawn args 'make', 233 error gyp info spawn args '-I', 233 error gyp info spawn args '/home/stress/shell-bot/node_modules/node-pty/build/config.gypi', 233 error gyp info spawn args '-I', 233 error gyp info spawn args '/usr/lib/node_modules_18/npm/node_modules/node-gyp/addon.gypi', 233 error gyp info spawn args '-I', 233 error gyp info spawn args '/home/stress/.cache/node-gyp/18.15.0/include/node/common.gypi', 233 error gyp info spawn args '-Dlibrary=shared_library', 233 error gyp info spawn args '-Dvisibility=default', 233 error gyp info spawn args '-Dnode_root_dir=/home/stress/.cache/node-gyp/18.15.0', 233 error gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules_18/npm/node_modules/node-gyp', 233 error gyp info spawn args '-Dnode_lib_file=/home/stress/.cache/node-gyp/18.15.0/<(target_arch)/node.lib', 233 error gyp info spawn args '-Dmodule_root_dir=/home/stress/shell-bot/node_modules/node-pty', 233 error gyp info spawn args '-Dnode_engine=v8', 233 error gyp info spawn args '--depth=.', 233 error gyp info spawn args '--no-parallel', 233 error gyp info spawn args '--generator-output', 233 error gyp info spawn args 'build', 233 error gyp info spawn args '-Goutput_dir=.' 233 error gyp info spawn args ] 233 error gyp info spawn make 233 error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] 233 error In file included from ../src/unix/pty.cc:20: 233 error ../node_modules/nan/nan.h: In function ‘void Nan::AsyncQueueWorker(AsyncWorker)’: 233 error ../node_modules/nan/nan.h:2298: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] 233 error 2298 | , reinterpret_cast(AsyncExecuteComplete) 233 error | ^~~~~~~~~~~~ 233 error ../node_modules/nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local, v8::Local, GetterCallback, SetterCallback, v8::Local, v8::AccessControl, v8::PropertyAttribute, imp::Sig)’: 233 error ../nodemodules/nan/nan.h:2536:19: warning: ‘void v8::ObjectTemplate::SetAccessor(v8::Local, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local, v8::AccessControl, v8::PropertyAttribute, v8::Local, v8::SideEffectType, v8::SideEffectType)’ is deprecated: Do signature check in accessor [-Wdeprecated-declarations] 233 error 2536 | tpl->SetAccessor( 233 error | ~~~~^ 233 error 2537 | name 233 error | ~~~~ 233 error 2538 | , getter 233 error | ~~~~~ 233 error 2539 | , setter_ 233 error | ~~~~~ 233 error 2540 | , obj 233 error | ~ 233 error 2541 | , settings 233 error | ~~ 233 error 2542 | , attribute 233 error | ~~~ 233 error 2543 | , signature); 233 error | ~~~~ 233 error In file included from /home/stress/.cache/node-gyp/18.15.0/include/node/v8-function.h:15, 233 error from /home/stress/.cache/node-gyp/18.15.0/include/node/v8.h:33, 233 error from /home/stress/.cache/node-gyp/18.15.0/include/node/node.h:73, 233 error from ../node_modules/nan/nan.h:54: 233 error /home/stress/.cache/node-gyp/18.15.0/include/node/v8-template.h:838:8: note: declared here 233 error 838 | void SetAccessor( 233 error | ^~~ 233 error In file included from ../node_modules/nan/nan.h:2884: 233 error ../node_modules/nan/nan_typedarray_contents.h: In constructor ‘Nan::TypedArrayContents::TypedArrayContents(v8::Local)’: 233 error ../node_modules/nan/nan_typedarray_contents.h:34:43: error: ‘class v8::ArrayBuffer’ has no member named ‘GetContents’ 233 error 34 | data = static_cast<char>(buffer->GetContents().Data()) + byte_offset; 233 error | ^~~ 233 error ../src/unix/pty.cc: In function ‘void pty_after_waitpid(uv_async_t)’: 233 error ../src/unix/pty.cc:486:9: warning: ‘void memset(void, int, size_t)’ writing to an object of type ‘class Nan::Persistent’ with no trivial copy-assignment [-Wclass-memaccess] 233 error 486 | memset(&baton->cb, -1, sizeof(baton->cb)); 233 error | ~~^~~~~~~~~~~ 233 error In file included from ../node_modules/nan/nan.h:403: 233 error ../node_modules/nan/nan_persistent_12_inl.h:12:40: note: ‘class Nan::Persistent’ declared here 233 error 12 | template<typename T, typename M> class Persistent : 233 error | ^~~~~~ 233 error ../src/unix/pty.cc: At global scope: 233 error /home/stress/.cache/node-gyp/18.15.0/include/node/node.h:978:7: warning: cast between incompatible function types from ‘void ()(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void ()(v8::Local)’} to ‘node::addon_register_func’ {aka ‘void ()(v8::Local, v8::Local, void*)’} [-Wcast-function-type] 233 error 978 | (node::addon_register_func) (regfunc), \ 233 error | ^~~~~~~~~ 233 error /home/stress/.cache/node-gyp/18.15.0/include/node/node.h:1012:3: note: in expansion of macro ‘NODE_MODULE_X’ 233 error 1012 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage) 233 error | ^~~~~ 233 error ../src/unix/pty.cc:708:1: note: in expansion of macro ‘NODE_MODULE’ 233 error 708 | NODE_MODULE(pty, init) 233 error | ^~~ 233 error make: *** [pty.target.mk:112: Release/obj.target/pty/src/unix/pty.o] Error 1 233 error gyp ERR! build error 233 error gyp ERR! stack Error: make failed with exit code: 2 233 error gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules_18/npm/node_modules/node-gyp/lib/build.js:203:23) 233 error gyp ERR! stack at ChildProcess.emit (node:events:513:28) 233 error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12) 233 error gyp ERR! System Linux 6.2.7-200.fc37.x86_64 233 error gyp ERR! command "/usr/bin/node-18" "/usr/lib/node_modules_18/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 233 error gyp ERR! cwd /home/stress/shell-bot/node_modules/node-pty 233 error gyp ERR! node -v v18.15.0 233 error gyp ERR! node-gyp -v v9.3.1 233 error gyp ERR! not ok 234 verbose exit 1 235 timing npm Completed in 12103ms 236 verbose unfinished npm timer reify 1679928138202 237 verbose unfinished npm timer reify:build 1679928140908 238 verbose unfinished npm timer build 1679928140909 239 verbose unfinished npm timer build:deps 1679928140909 240 verbose unfinished npm timer build:run:install 1679928140914 241 verbose unfinished npm timer build:run:install:node_modules/node-pty 1679928140914 242 verbose unfinished npm timer build:run:install:node_modules/node-termios 1679928140926 243 verbose code 1 244 error A complete log of this run can be found in: 244 error /home/stress/.npm/_logs/2023-03-27T14_42_18_150Z-debug-0.log

0n1cOn3 commented 1 year ago

a manual installation of node-pty@0.10.1 and botgram did the trick. Maybe its worth it to add a note for fedora systems, dunno. Im not a js dev ^^