About testing upgrade node.js 15.x to 16.x, that didn't go well.
Here are the steps I took.
-
Command: curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash
-
sudo apt-get install -y node.js
-
cd ~/.node-red
-
npm rebuild
At point 4 I got a lot of errors. See this error log
> 0 verbose cli /usr/bin/node /usr/bin/npm
> 1 info using npm@8.15.0
> 2 info using node@v16.17.1
> 3 timing npm:load:whichnode Completed in 1ms
> 4 timing config:load:defaults Completed in 8ms
> 5 timing config:load:file:/usr/lib/node_modules/npm/npmrc Completed in 3ms
> 6 timing config:load:builtin Completed in 4ms
> 7 timing config:load:cli Completed in 7ms
> 8 timing config:load:env Completed in 2ms
> 9 timing config:load:file:/home/pi/.node-red/.npmrc Completed in 1ms
> 10 timing config:load:project Completed in 14ms
> 11 timing config:load:file:/home/pi/.npmrc Completed in 3ms
> 12 timing config:load:user Completed in 4ms
> 13 timing config:load:file:/usr/etc/npmrc Completed in 1ms
> 14 timing config:load:global Completed in 1ms
> 15 timing config:load:validate Completed in 2ms
> 16 timing config:load:credentials Completed in 4ms
> 17 timing config:load:setEnvs Completed in 4ms
> 18 timing config:load Completed in 54ms
> 19 timing npm:load:configload Completed in 55ms
> 20 timing npm:load:mkdirpcache Completed in 4ms
> 21 timing npm:load:mkdirplogs Completed in 1ms
> 22 verbose title npm rebuild
> 23 verbose argv "rebuild"
> 24 timing npm:load:setTitle Completed in 4ms
> 25 timing config:load:flatten Completed in 14ms
> 26 timing npm:load:display Completed in 47ms
> 27 verbose logfile logs-max:10 dir:/home/pi/.npm/_logs
> 28 verbose logfile /home/pi/.npm/_logs/2022-10-02T13_10_07_825Z-debug-0.log
> 29 timing npm:load:logFile Completed in 74ms
> 30 timing npm:load:timers Completed in 1ms
> 31 timing npm:load:configScope Completed in 0ms
> 32 timing npm:load Completed in 192ms
> 33 timing arborist:ctor Completed in 3ms
> 34 silly logfile done cleaning log files
> 35 verbose shrinkwrap failed to load node_modules/.package-lock.json out of date, updated: node_modules/bufferutil
> 36 timing build:queue Completed in 58ms
> 37 timing build:link:node_modules/acorn Completed in 20ms
> 38 timing build:link:node_modules/bwip-js Completed in 17ms
> 39 timing build:link:node_modules/is-base64 Completed in 17ms
> 40 timing build:link:node_modules/mime Completed in 16ms
> 41 timing build:link:node_modules/jsmodbus Completed in 16ms
> 42 timing build:link:node_modules/mkdirp Completed in 16ms
> 43 timing build:link:node_modules/mustache Completed in 15ms
> 44 timing build:link:node_modules/node-gyp-build Completed in 16ms
> 45 timing build:link:node_modules/pixelmatch Completed in 14ms
> 46 timing build:link:node_modules/prebuild-install Completed in 13ms
> 47 timing build:link:node_modules/rc Completed in 13ms
> 48 timing build:link:node_modules/semver Completed in 12ms
> 49 timing build:link:node_modules/systeminformation Completed in 11ms
> 50 timing build:link:node_modules/sshpk Completed in 13ms
> 51 timing build:link:node_modules/vm2 Completed in 11ms
> 52 timing build:link:node_modules/which Completed in 11ms
> 53 timing build:link:node_modules/node-red-contrib-ui-multistate-switch/node_modules/mustache Completed in 10ms
> 54 timing build:link:node_modules/request/node_modules/uuid Completed in 10ms
> 55 timing build:link Completed in 24ms
> 56 info run @serialport/bindings@9.2.8 install node_modules/@serialport/bindings prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
> 57 info run bufferutil@1.2.1 install node_modules/bufferutil node-gyp rebuild
> 58 info run gc-stats@1.0.0 install node_modules/gc-stats node-gyp rebuild
> 59 info run bufferutil@4.0.6 install node_modules/engine.io/node_modules/bufferutil node-gyp-build
> 60 info run bufferutil@4.0.6 install { code: 0, signal: null }
> 61 timing build:run:install:node_modules/engine.io/node_modules/bufferutil Completed in 1352ms
> 62 info run utf-8-validate@5.0.9 install node_modules/engine.io/node_modules/utf-8-validate node-gyp-build
> 63 info run utf-8-validate@5.0.9 install { code: 0, signal: null }
> 64 timing build:run:install:node_modules/engine.io/node_modules/utf-8-validate Completed in 1239ms
> 65 info run bufferutil@1.2.1 install { code: 1, signal: null }
> 66 timing command:rebuild Completed in 14228ms
> 67 verbose stack Error: command failed
> 67 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:63:27)
> 67 verbose stack at ChildProcess.emit (node:events:513:28)
> 67 verbose stack at maybeClose (node:internal/child_process:1093:16)
> 67 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
> 68 verbose pkgid bufferutil@1.2.1
> 69 verbose cwd /home/pi/.node-red
> 70 verbose Linux 5.10.63-v7+
> 71 verbose node v16.17.1
> 72 verbose npm v8.15.0
> 73 error code 1
> 74 error path /home/pi/.node-red/node_modules/bufferutil
> 75 error command failed
> 76 error command sh /tmp/install-2a82c177.sh
> 77 error make: Map '/home/pi/.node-red/node_modules/bufferutil/build' wordt binnengegaan
> 77 error CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
> 77 error make: Map '/home/pi/.node-red/node_modules/bufferutil/build' wordt verlaten
> 78 error gyp info it worked if it ends with ok
> 78 error gyp info using node-gyp@9.0.0
> 78 error gyp info using node@16.17.1 | linux | arm
> 78 error gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3"
> 78 error gyp info spawn /usr/bin/python3
> 78 error gyp info spawn args [
> 78 error gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
> 78 error gyp info spawn args 'binding.gyp',
> 78 error gyp info spawn args '-f',
> 78 error gyp info spawn args 'make',
> 78 error gyp info spawn args '-I',
> 78 error gyp info spawn args '/home/pi/.node-red/node_modules/bufferutil/build/config.gypi',
> 78 error gyp info spawn args '-I',
> 78 error gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
> 78 error gyp info spawn args '-I',
> 78 error gyp info spawn args '/home/pi/.cache/node-gyp/16.17.1/include/node/common.gypi',
> 78 error gyp info spawn args '-Dlibrary=shared_library',
> 78 error gyp info spawn args '-Dvisibility=default',
> 78 error gyp info spawn args '-Dnode_root_dir=/home/pi/.cache/node-gyp/16.17.1',
> 78 error gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
> 78 error gyp info spawn args '-Dnode_lib_file=/home/pi/.cache/node-gyp/16.17.1/<(target_arch)/node.lib',
> 78 error gyp info spawn args '-Dmodule_root_dir=/home/pi/.node-red/node_modules/bufferutil',
> 78 error gyp info spawn args '-Dnode_engine=v8',
> 78 error gyp info spawn args '--depth=.',
> 78 error gyp info spawn args '--no-parallel',
> 78 error gyp info spawn args '--generator-output',
> 78 error gyp info spawn args 'build',
> 78 error gyp info spawn args '-Goutput_dir=.'
> 78 error gyp info spawn args ]
> 78 error gyp info spawn make
> 78 error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
> 78 error ../src/bufferutil.cc:25:30: error: ‘v8::Handle’ has not been declared
> 78 error static void Initialize(v8::Handle<v8::Object> target)
> 78 error ^~~~~~
> 78 error ../src/bufferutil.cc:25:36: error: expected ‘,’ or ‘...’ before ‘<’ token
> 78 error static void Initialize(v8::Handle<v8::Object> target)
> 78 error ^
> 78 error ../src/bufferutil.cc: In static member function ‘static void BufferUtil::Initialize(int)’:
> 78 error ../src/bufferutil.cc:33:14: error: ‘target’ was not declared in this scope
> 78 error Nan::Set(target, Nan::New<String>("BufferUtil").ToLocalChecked(), t->GetFunction());
> 78 error ^~~~~~
> 78 error ../src/bufferutil.cc:33:14: note: suggested alternative: ‘Merge’
> 78 error Nan::Set(target, Nan::New<String>("BufferUtil").ToLocalChecked(), t->GetFunction());
> 78 error ^~~~~~
> 78 error Merge
> 78 error ../src/bufferutil.cc:33:86: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
> 78 error Nan::Set(target, Nan::New<String>("BufferUtil").ToLocalChecked(), t->GetFunction());
> 78 error ^
> 78 error In file included from ../src/bufferutil.cc:7:
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:6802:46: note: candidate: ‘v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)’
> 78 error V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
> 78 error ^~~~~~~~~~~
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:6802:46: note: candidate expects 1 argument, 0 provided
> 78 error ../src/bufferutil.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE BufferUtil::Merge(Nan::NAN_METHOD_ARGS_TYPE)’:
> 78 error ../src/bufferutil.cc:49:49: error: no matching function for call to ‘v8::Value::ToObject()’
> 78 error Local<Object> bufferObj = info[0]->ToObject();
> 78 error ^
> 78 error In file included from ../src/bufferutil.cc:7:
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:3060:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
> 78 error V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
> 78 error ^~~~~~~~
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:3060:44: note: candidate expects 1 argument, 0 provided
> 78 error ../src/bufferutil.cc:56:39: error: no matching function for call to ‘v8::Array::Get(unsigned int&)’
> 78 error Local<Object> src = array->Get(i)->ToObject();
> 78 error ^
> 78 error In file included from ../src/bufferutil.cc:7:
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:4007:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
> 78 error V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
> 78 error ^~~
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:4007:43: note: candidate expects 2 arguments, 1 provided
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:4010:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
> 78 error V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
> 78 error ^~~
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:4010:43: note: candidate expects 2 arguments, 1 provided
> 78 error ../src/bufferutil.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE BufferUtil::Unmask(Nan::NAN_METHOD_ARGS_TYPE)’:
> 78 error ../src/bufferutil.cc:67:50: error: no matching function for call to ‘v8::Value::ToObject()’
> 78 error Local<Object> buffer_obj = info[0]->ToObject();
> 78 error ^
> 78 error In file included from ../src/bufferutil.cc:7:
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:3060:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
> 78 error V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
> 78 error ^~~~~~~~
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:3060:44: note: candidate expects 1 argument, 0 provided
> 78 error ../src/bufferutil.cc:69:48: error: no matching function for call to ‘v8::Value::ToObject()’
> 78 error Local<Object> mask_obj = info[1]->ToObject();
> 78 error ^
> 78 error In file included from ../src/bufferutil.cc:7:
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:3060:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
> 78 error V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
> 78 error ^~~~~~~~
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:3060:44: note: candidate expects 1 argument, 0 provided
> 78 error ../src/bufferutil.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE BufferUtil::Mask(Nan::NAN_METHOD_ARGS_TYPE)’:
> 78 error ../src/bufferutil.cc:88:50: error: no matching function for call to ‘v8::Value::ToObject()’
> 78 error Local<Object> buffer_obj = info[0]->ToObject();
> 78 error ^
> 78 error In file included from ../src/bufferutil.cc:7:
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:3060:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
> 78 error V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
> 78 error ^~~~~~~~
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:3060:44: note: candidate expects 1 argument, 0 provided
> 78 error ../src/bufferutil.cc:89:48: error: no matching function for call to ‘v8::Value::ToObject()’
> 78 error Local<Object> mask_obj = info[1]->ToObject();
> 78 error ^
> 78 error In file included from ../src/bufferutil.cc:7:
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:3060:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
> 78 error V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
> 78 error ^~~~~~~~
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:3060:44: note: candidate expects 1 argument, 0 provided
> 78 error ../src/bufferutil.cc:91:50: error: no matching function for call to ‘v8::Value::ToObject()’
> 78 error Local<Object> output_obj = info[2]->ToObject();
> 78 error ^
> 78 error In file included from ../src/bufferutil.cc:7:
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:3060:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
> 78 error V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
> 78 error ^~~~~~~~
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:3060:44: note: candidate expects 1 argument, 0 provided
> 78 error ../src/bufferutil.cc:92:51: error: no matching function for call to ‘v8::Value::Int32Value()’
> 78 error unsigned int dataOffset = info[3]->Int32Value();
> 78 error ^
> 78 error In file included from ../src/bufferutil.cc:7:
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:3107:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
> 78 error V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
> 78 error ^~~~~~~~~~
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:3107:40: note: candidate expects 1 argument, 0 provided
> 78 error ../src/bufferutil.cc:93:47: error: no matching function for call to ‘v8::Value::Int32Value()’
> 78 error unsigned int length = info[4]->Int32Value();
> 78 error ^
> 78 error In file included from ../src/bufferutil.cc:7:
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:3107:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
> 78 error V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
> 78 error ^~~~~~~~~~
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/v8.h:3107:40: note: candidate expects 1 argument, 0 provided
> 78 error ../src/bufferutil.cc: At global scope:
> 78 error ../src/bufferutil.cc:114:12: error: variable or field ‘init’ declared void
> 78 error void init (Handle<Object> target)
> 78 error ^~~~~~
> 78 error ../src/bufferutil.cc:114:12: error: ‘Handle’ was not declared in this scope
> 78 error ../src/bufferutil.cc:114:12: note: suggested alternative: ‘rand_r’
> 78 error void init (Handle<Object> target)
> 78 error ^~~~~~
> 78 error rand_r
> 78 error ../src/bufferutil.cc:114:25: error: expected primary-expression before ‘>’ token
> 78 error void init (Handle<Object> target)
> 78 error ^
> 78 error ../src/bufferutil.cc:114:27: error: ‘target’ was not declared in this scope
> 78 error void init (Handle<Object> target)
> 78 error ^~~~~~
> 78 error ../src/bufferutil.cc:114:27: note: suggested alternative: ‘tzset’
> 78 error void init (Handle<Object> target)
> 78 error ^~~~~~
> 78 error tzset
> 78 error In file included from ../src/bufferutil.cc:8:
> 78 error ../src/bufferutil.cc:120:25: error: ‘init’ was not declared in this scope
> 78 error NODE_MODULE(bufferutil, init)
> 78 error ^~~~
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/node.h:859:36: note: in definition of macro ‘NODE_MODULE_X’
> 78 error (node::addon_register_func) (regfunc), \
> 78 error ^~~~~~~
> 78 error ../src/bufferutil.cc:120:1: note: in expansion of macro ‘NODE_MODULE’
> 78 error NODE_MODULE(bufferutil, init)
> 78 error ^~~~~~~~~~~
> 78 error ../src/bufferutil.cc:120:25: note: suggested alternative: ‘int’
> 78 error NODE_MODULE(bufferutil, init)
> 78 error ^~~~
> 78 error /home/pi/.cache/node-gyp/16.17.1/include/node/node.h:859:36: note: in definition of macro ‘NODE_MODULE_X’
> 78 error (node::addon_register_func) (regfunc), \
> 78 error ^~~~~~~
> 78 error ../src/bufferutil.cc:120:1: note: in expansion of macro ‘NODE_MODULE’
> 78 error NODE_MODULE(bufferutil, init)
> 78 error ^~~~~~~~~~~
> 78 error make: *** [bufferutil.target.mk:112: Release/obj.target/bufferutil/src/bufferutil.o] Fout 1
> 78 error gyp ERR! build error
> 78 error gyp ERR! stack Error: `make` failed with exit code: 2
> 78 error gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
> 78 error gyp ERR! stack at ChildProcess.emit (node:events:513:28)
> 78 error gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
> 78 error gyp ERR! System Linux 5.10.63-v7+
> 78 error gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
> 78 error gyp ERR! cwd /home/pi/.node-red/node_modules/bufferutil
> 78 error gyp ERR! node -v v16.17.1
> 78 error gyp ERR! node-gyp -v v9.0.0
> 78 error gyp ERR! not ok
> 79 verbose exit 1
> 80 timing npm Completed in 14949ms
> 81 verbose unfinished npm timer build 1664716211162
> 82 verbose unfinished npm timer build:deps 1664716211164
> 83 verbose unfinished npm timer build:run:install 1664716211249
> 84 verbose unfinished npm timer build:run:install:node_modules/@serialport/bindings 1664716211250
> 85 verbose unfinished npm timer build:run:install:node_modules/bufferutil 1664716211283
> 86 verbose unfinished npm timer build:run:install:node_modules/gc-stats 1664716211301
> 87 verbose code 1
> 88 error A complete log of this run can be found in:
> 88 error /home/pi/.npm/_logs/2022-10-02T13_10_07_825Z-debug-0.log
````Preformatted text`