Not able to start on rpi

Hello, long time listener, first time caller.

I installed node red on my pi with these instructions Running on Raspberry Pi : Node-RED

The installation seemed to be successful but when I try to access the editor remotely on a browser I receive the following message:

TypeError: contentType.parse is not a function
    at setCharset (/usr/lib/node_modules/node-red/node_modules/express/lib/utils.js:256:28)
    at ServerResponse.send (/usr/lib/node_modules/node-red/node_modules/express/lib/response.js:170:32)
    at editor (/usr/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/ui.js:72:13)
    at Layer.handle [as handle_request] (/usr/lib/node_modules/node-red/node_modules/express/lib/router/layer.js:95:5)
    at next (/usr/lib/node_modules/node-red/node_modules/express/lib/router/route.js:137:13)
    at ensureSlash (/usr/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/ui.js:46:13)
    at Layer.handle [as handle_request] (/usr/lib/node_modules/node-red/node_modules/express/lib/router/layer.js:95:5)
    at next (/usr/lib/node_modules/node-red/node_modules/express/lib/router/route.js:137:13)
    at /usr/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/index.js:39:13
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

The raspberry pi terminal window shows this on startup:

Starting as a systemd service.
14 Mar 17:58:32 - [info]
Welcome to Node-RED
===================
14 Mar 17:58:32 - [info] Node-RED version: v1.2.9
14 Mar 17:58:33 - [info] Node.js  version: v12.20.1
14 Mar 17:58:33 - [info] Linux 5.4.83+ arm LE
14 Mar 17:58:40 - [info] Loading palette nodes
14 Mar 17:58:59 - [warn] ------------------------------------------------------
14 Mar 17:58:59 - [warn] [node-red/mqtt] TypeError: debug_1.default is not a function
14 Mar 17:58:59 - [warn] [node-red/websocket] TypeError: debug_1.default is not a function
14 Mar 17:58:59 - [warn] ------------------------------------------------------
14 Mar 17:58:59 - [info] Settings file  : /home/pi/.node-red/settings.js
14 Mar 17:58:59 - [info] Context store  : 'default' [module=memory]
14 Mar 17:58:59 - [info] User directory : /home/pi/.node-red
14 Mar 17:58:59 - [warn] Projects disabled : editorTheme.projects.enabled=false
14 Mar 17:58:59 - [info] Flows file     : /home/pi/.node-red/flows_raspberrypi.json
14 Mar 17:58:59 - [info] Creating new flow file
14 Mar 17:58:59 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
14 Mar 17:58:59 - [info] Starting flows
14 Mar 17:58:59 - [info] Started flows
14 Mar 17:59:00 - [info] Server now running at http://127.0.0.1:1880/

I am using Raspberry pi 1 rev 2 model B. OS: Raspbian GNU/Linux 10 (buster).

Any ideas how to proceed? I am going to reinstall node red to see if it might help.

thank you

Also wanted to include the install log in case there was anything that might have went wrong there. thank you for your help!


***************************************

Started : Sun 14 Mar 2021 01:45:53 PM EDT
Running for user pi at /home/pi
Failed to stop nodered.service: Unit nodered.service not loaded.
Found global nodes:   :

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodered' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 94 not upgraded.
Now install nodejs

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodejs-legacy' is not installed, so not removed
Package 'nodejs' is not installed, so not removed
Package 'npm' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 94 not upgraded.
Versions: node:v12.20.1 npm:6.14.10
npm WARN using --force I sure hope you know what you are doing.
Now install Node-RED
npm WARN deprecated bcrypt@3.0.6: versions < v5.0.0 do not handle NUL in passwords properly
npm WARN deprecated node-pre-gyp@0.12.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated request@2.88.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated bcrypt@3.0.8: versions < v5.0.0 do not handle NUL in passwords properly
npm WARN deprecated node-pre-gyp@0.14.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
/usr/bin/node-red -> /usr/lib/node_modules/node-red/red.js
/usr/bin/node-red-pi -> /usr/lib/node_modules/node-red/bin/node-red-pi

> bcrypt@3.0.6 install /usr/lib/node_modules/node-red/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.6/bcrypt_lib-v3.0.6-node-v72-linux-arm-glibc.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.6 and node@12.20.1 (node-v72 ABI, glibc) (falling back to source compile with node-gyp) 
make: Entering directory '/usr/lib/node_modules/node-red/node_modules/bcrypt/build'
  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
In file included from ../src/bcrypt_node.cc:1:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2232:62: 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]
     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
                                                              ^
In file included from ../../nan/nan.h:53,
                 from ../src/bcrypt_node.cc:1:
../src/bcrypt_node.cc: At global scope:
/root/.cache/node-gyp/12.20.1/include/node/node.h:737:43: 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]
       (node::addon_register_func) (regfunc),                          \
                                           ^
/root/.cache/node-gyp/12.20.1/include/node/node.h:771:3: note: in expansion of macro ‘NODE_MODULE_X’
   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
   ^~~~~~~~~~~~~
../src/bcrypt_node.cc:378:1: note: in expansion of macro ‘NODE_MODULE’
 NODE_MODULE(bcrypt_lib, init);
 ^~~~~~~~~~~
  SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
  COPY Release/bcrypt_lib.node
  COPY /usr/lib/node_modules/node-red/node_modules/bcrypt/lib/binding/bcrypt_lib.node
  TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory '/usr/lib/node_modules/node-red/node_modules/bcrypt/build'

> bcrypt@3.0.8 install /usr/lib/node_modules/node-red/node_modules/node-red-admin/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

/usr/lib/node_modules/node-red/node_modules/gauge/themes.js:20
    preComplete: consoleControl.color('inverse'),
                                ^

TypeError: consoleControl.color is not a function
    at Object.<anonymous> (/usr/lib/node_modules/node-red/node_modules/gauge/themes.js:20:33)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/lib/node_modules/node-red/node_modules/gauge/index.js:6:21)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: bcrypt@3.0.8 (node_modules/node-red/node_modules/node-red-admin/node_modules/bcrypt):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: bcrypt@3.0.8 install: `node-pre-gyp install --fallback-to-build`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ node-red@1.2.9
added 346 packages from 319 contributors in 1035.402s
1.2.9 
Now create basic package.json for the user and move any global nodes
Installing extra nodes: node-red-node-pi-gpio@latest node-red-node-random@latest node-red-node-ping@latest node-red-contrib-play-audio@latest node-red-node-smooth@latest node-red-node-serialport@latest :

> @serialport/bindings@9.0.7 install /home/pi/.node-red/node_modules/@serialport/bindings
> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=12.20.1 runtime=node arch=arm libc= platform=linux)
make: Entering directory '/home/pi/.node-red/node_modules/@serialport/bindings/build'
  CXX(target) Release/obj.target/bindings/src/serialport.o
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Open(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:78:69: 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]
   uv_queue_work(uv_default_loop(), req, EIO_Open, (uv_after_work_cb)EIO_AfterOpen);
                                                                     ^~~~~~~~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Update(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:135:71: 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]
   uv_queue_work(uv_default_loop(), req, EIO_Update, (uv_after_work_cb)EIO_AfterUpdate);
                                                                       ^~~~~~~~~~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Close(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:175:70: 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]
   uv_queue_work(uv_default_loop(), req, EIO_Close, (uv_after_work_cb)EIO_AfterClose);
                                                                      ^~~~~~~~~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Flush(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:215:70: 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]
   uv_queue_work(uv_default_loop(), req, EIO_Flush, (uv_after_work_cb)EIO_AfterFlush);
                                                                      ^~~~~~~~~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Set(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:271:68: 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]
   uv_queue_work(uv_default_loop(), req, EIO_Set, (uv_after_work_cb)EIO_AfterSet);
                                                                    ^~~~~~~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Get(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:316:68: 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]
   uv_queue_work(uv_default_loop(), req, EIO_Get, (uv_after_work_cb)EIO_AfterGet);
                                                                    ^~~~~~~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE GetBaudRate(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:366:76: 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]
   uv_queue_work(uv_default_loop(), req, EIO_GetBaudRate, (uv_after_work_cb)EIO_AfterGetBaudRate);
                                                                            ^~~~~~~~~~~~~~~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Drain(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:412:70: 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]
   uv_queue_work(uv_default_loop(), req, EIO_Drain, (uv_after_work_cb)EIO_AfterDrain);
                                                                      ^~~~~~~~~~~~~~
../src/serialport.cpp: At global scope:
../src/serialport.cpp:433:28: warning: unnecessary parentheses in declaration of ‘ToParityEnum’ [-Wparentheses]
 SerialPortParity NAN_INLINE(ToParityEnum(const v8::Local<v8::String>& v8str)) {
                            ^
../src/serialport.cpp:452:30: warning: unnecessary parentheses in declaration of ‘ToStopBitEnum’ [-Wparentheses]
 SerialPortStopBits NAN_INLINE(ToStopBitEnum(double stopBits)) {
                              ^
In file included from ../../../nan/nan.h:56,
                 from ../src/./serialport.h:6,
                 from ../src/serialport.cpp:1:
/home/pi/.cache/node-gyp/12.20.1/include/node/node.h:737:43: 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]
       (node::addon_register_func) (regfunc),                          \
                                           ^
/home/pi/.cache/node-gyp/12.20.1/include/node/node.h:771:3: note: in expansion of macro ‘NODE_MODULE_X’
   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
   ^~~~~~~~~~~~~
../src/serialport.cpp:486:1: note: in expansion of macro ‘NODE_MODULE’
 NODE_MODULE(serialport, init);
 ^~~~~~~~~~~
  CXX(target) Release/obj.target/bindings/src/serialport_unix.o
../src/serialport_unix.cpp: In function ‘int setup(int, OpenBaton*)’:
../src/serialport_unix.cpp:176:60: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1005 [-Wformat-truncation=]
     snprintf(data->errorString, sizeof(data->errorString), "Error %s Cannot open %s", strerror(errno), data->path);
                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~
../src/serialport_unix.cpp:176:13: note: ‘snprintf’ output 20 or more bytes (assuming 1043) into a destination of size 1024
     snprintf(data->errorString, sizeof(data->errorString), "Error %s Cannot open %s", strerror(errno), data->path);
     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/serialport_unix.cpp: In function ‘void EIO_Open(uv_work_t*)’:
../src/serialport_unix.cpp:86:60: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1003 [-Wformat-truncation=]
     snprintf(data->errorString, sizeof(data->errorString), "Error: %s, cannot open %s", strerror(errno), data->path);
                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/serialport_unix.cpp:86:13: note: ‘snprintf’ output 22 or more bytes (assuming 1045) into a destination of size 1024
     snprintf(data->errorString, sizeof(data->errorString), "Error: %s, cannot open %s", strerror(errno), data->path);
     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CXX(target) Release/obj.target/bindings/src/poller.o
  CXX(target) Release/obj.target/bindings/src/serialport_linux.o
  SOLINK_MODULE(target) Release/obj.target/bindings.node
  COPY Release/bindings.node
make: Leaving directory '/home/pi/.node-red/node_modules/@serialport/bindings/build'
npm notice created a lockfile as package-lock.json. You should commit this file.
+ node-red-node-pi-gpio@1.2.3
+ node-red-node-serialport@0.13.0
+ node-red-node-random@0.4.0
+ node-red-contrib-play-audio@2.5.0
+ node-red-node-smooth@0.1.2
+ node-red-node-ping@0.3.0
added 82 packages from 52 contributors in 388.187s

> @serialport/bindings@9.0.7 install /home/pi/.node-red/node_modules/@serialport/bindings
> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=12.20.1 runtime=node arch=arm libc= platform=linux)
make: Entering directory '/home/pi/.node-red/node_modules/@serialport/bindings/build'
  CXX(target) Release/obj.target/bindings/src/serialport.o
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Open(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:78:69: 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]
   uv_queue_work(uv_default_loop(), req, EIO_Open, (uv_after_work_cb)EIO_AfterOpen);
                                                                     ^~~~~~~~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Update(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:135:71: 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]
   uv_queue_work(uv_default_loop(), req, EIO_Update, (uv_after_work_cb)EIO_AfterUpdate);
                                                                       ^~~~~~~~~~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Close(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:175:70: 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]
   uv_queue_work(uv_default_loop(), req, EIO_Close, (uv_after_work_cb)EIO_AfterClose);
                                                                      ^~~~~~~~~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Flush(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:215:70: 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]
   uv_queue_work(uv_default_loop(), req, EIO_Flush, (uv_after_work_cb)EIO_AfterFlush);
                                                                      ^~~~~~~~~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Set(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:271:68: 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]
   uv_queue_work(uv_default_loop(), req, EIO_Set, (uv_after_work_cb)EIO_AfterSet);
                                                                    ^~~~~~~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Get(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:316:68: 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]
   uv_queue_work(uv_default_loop(), req, EIO_Get, (uv_after_work_cb)EIO_AfterGet);
                                                                    ^~~~~~~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE GetBaudRate(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:366:76: 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]
   uv_queue_work(uv_default_loop(), req, EIO_GetBaudRate, (uv_after_work_cb)EIO_AfterGetBaudRate);
                                                                            ^~~~~~~~~~~~~~~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Drain(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:412:70: 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]
   uv_queue_work(uv_default_loop(), req, EIO_Drain, (uv_after_work_cb)EIO_AfterDrain);
                                                                      ^~~~~~~~~~~~~~
../src/serialport.cpp: At global scope:
../src/serialport.cpp:433:28: warning: unnecessary parentheses in declaration of ‘ToParityEnum’ [-Wparentheses]
 SerialPortParity NAN_INLINE(ToParityEnum(const v8::Local<v8::String>& v8str)) {
                            ^
../src/serialport.cpp:452:30: warning: unnecessary parentheses in declaration of ‘ToStopBitEnum’ [-Wparentheses]
 SerialPortStopBits NAN_INLINE(ToStopBitEnum(double stopBits)) {
                              ^
In file included from ../../../nan/nan.h:56,
                 from ../src/./serialport.h:6,
                 from ../src/serialport.cpp:1:
/home/pi/.cache/node-gyp/12.20.1/include/node/node.h:737:43: 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]
       (node::addon_register_func) (regfunc),                          \
                                           ^
/home/pi/.cache/node-gyp/12.20.1/include/node/node.h:771:3: note: in expansion of macro ‘NODE_MODULE_X’
   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
   ^~~~~~~~~~~~~
../src/serialport.cpp:486:1: note: in expansion of macro ‘NODE_MODULE’
 NODE_MODULE(serialport, init);
 ^~~~~~~~~~~
  CXX(target) Release/obj.target/bindings/src/serialport_unix.o
../src/serialport_unix.cpp: In function ‘int setup(int, OpenBaton*)’:
../src/serialport_unix.cpp:176:60: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1005 [-Wformat-truncation=]
     snprintf(data->errorString, sizeof(data->errorString), "Error %s Cannot open %s", strerror(errno), data->path);
                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~
../src/serialport_unix.cpp:176:13: note: ‘snprintf’ output 20 or more bytes (assuming 1043) into a destination of size 1024
     snprintf(data->errorString, sizeof(data->errorString), "Error %s Cannot open %s", strerror(errno), data->path);
     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/serialport_unix.cpp: In function ‘void EIO_Open(uv_work_t*)’:
../src/serialport_unix.cpp:86:60: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1003 [-Wformat-truncation=]
     snprintf(data->errorString, sizeof(data->errorString), "Error: %s, cannot open %s", strerror(errno), data->path);
                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/serialport_unix.cpp:86:13: note: ‘snprintf’ output 22 or more bytes (assuming 1045) into a destination of size 1024
     snprintf(data->errorString, sizeof(data->errorString), "Error: %s, cannot open %s", strerror(errno), data->path);
     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CXX(target) Release/obj.target/bindings/src/poller.o
  CXX(target) Release/obj.target/bindings/src/serialport_linux.o
  SOLINK_MODULE(target) Release/obj.target/bindings.node
  COPY Release/bindings.node
make: Leaving directory '/home/pi/.node-red/node_modules/@serialport/bindings/build'
node-red-contrib-play-audio@2.5.0 /home/pi/.node-red/node_modules/node-red-contrib-play-audio
node-red-node-pi-gpio@1.2.3 /home/pi/.node-red/node_modules/node-red-node-pi-gpio
node-red-node-ping@0.3.0 /home/pi/.node-red/node_modules/node-red-node-ping
node-red-node-random@0.4.0 /home/pi/.node-red/node_modules/node-red-node-random
node-red-node-serialport@0.13.0 /home/pi/.node-red/node_modules/node-red-node-serialport
serialport@9.0.7 /home/pi/.node-red/node_modules/serialport
@serialport/binding-mock@9.0.7 /home/pi/.node-red/node_modules/@serialport/binding-mock
@serialport/binding-abstract@9.0.7 /home/pi/.node-red/node_modules/@serialport/binding-abstract
debug@4.3.1 /home/pi/.node-red/node_modules/debug
ms@2.1.2 /home/pi/.node-red/node_modules/ms
@serialport/bindings@9.0.7 /home/pi/.node-red/node_modules/@serialport/bindings
@serialport/parser-readline@9.0.7 /home/pi/.node-red/node_modules/@serialport/parser-readline
@serialport/parser-delimiter@9.0.7 /home/pi/.node-red/node_modules/@serialport/parser-delimiter
bindings@1.5.0 /home/pi/.node-red/node_modules/bindings
file-uri-to-path@1.0.0 /home/pi/.node-red/node_modules/file-uri-to-path
nan@2.14.2 /home/pi/.node-red/node_modules/nan
prebuild-install@6.0.1 /home/pi/.node-red/node_modules/prebuild-install
detect-libc@1.0.3 /home/pi/.node-red/node_modules/detect-libc
expand-template@2.0.3 /home/pi/.node-red/node_modules/expand-template
github-from-package@0.0.0 /home/pi/.node-red/node_modules/github-from-package
minimist@1.2.5 /home/pi/.node-red/node_modules/minimist
mkdirp-classic@0.5.3 /home/pi/.node-red/node_modules/mkdirp-classic
napi-build-utils@1.0.2 /home/pi/.node-red/node_modules/napi-build-utils
node-abi@2.21.0 /home/pi/.node-red/node_modules/node-abi
semver@5.7.1 /home/pi/.node-red/node_modules/semver
noop-logger@0.1.1 /home/pi/.node-red/node_modules/noop-logger
npmlog@4.1.2 /home/pi/.node-red/node_modules/npmlog
are-we-there-yet@1.1.5 /home/pi/.node-red/node_modules/are-we-there-yet
delegates@1.0.0 /home/pi/.node-red/node_modules/delegates
readable-stream@2.3.7 /home/pi/.node-red/node_modules/readable-stream
core-util-is@1.0.2 /home/pi/.node-red/node_modules/core-util-is
inherits@2.0.4 /home/pi/.node-red/node_modules/inherits
isarray@1.0.0 /home/pi/.node-red/node_modules/isarray
process-nextick-args@2.0.1 /home/pi/.node-red/node_modules/process-nextick-args
safe-buffer@5.1.2 /home/pi/.node-red/node_modules/safe-buffer
string_decoder@1.1.1 /home/pi/.node-red/node_modules/string_decoder
util-deprecate@1.0.2 /home/pi/.node-red/node_modules/util-deprecate
console-control-strings@1.1.0 /home/pi/.node-red/node_modules/console-control-strings
gauge@2.7.4 /home/pi/.node-red/node_modules/gauge
aproba@1.2.0 /home/pi/.node-red/node_modules/aproba
has-unicode@2.0.1 /home/pi/.node-red/node_modules/has-unicode
object-assign@4.1.1 /home/pi/.node-red/node_modules/object-assign
signal-exit@3.0.3 /home/pi/.node-red/node_modules/signal-exit
string-width@1.0.2 /home/pi/.node-red/node_modules/string-width
code-point-at@1.1.0 /home/pi/.node-red/node_modules/code-point-at
is-fullwidth-code-point@1.0.0 /home/pi/.node-red/node_modules/is-fullwidth-code-point
number-is-nan@1.0.1 /home/pi/.node-red/node_modules/number-is-nan
strip-ansi@3.0.1 /home/pi/.node-red/node_modules/strip-ansi
ansi-regex@2.1.1 /home/pi/.node-red/node_modules/ansi-regex
wide-align@1.1.3 /home/pi/.node-red/node_modules/wide-align
set-blocking@2.0.0 /home/pi/.node-red/node_modules/set-blocking
pump@3.0.0 /home/pi/.node-red/node_modules/pump
end-of-stream@1.4.4 /home/pi/.node-red/node_modules/end-of-stream
once@1.4.0 /home/pi/.node-red/node_modules/once
wrappy@1.0.2 /home/pi/.node-red/node_modules/wrappy
rc@1.2.8 /home/pi/.node-red/node_modules/rc
deep-extend@0.6.0 /home/pi/.node-red/node_modules/deep-extend
ini@1.3.8 /home/pi/.node-red/node_modules/ini
strip-json-comments@2.0.1 /home/pi/.node-red/node_modules/strip-json-comments
simple-get@3.1.0 /home/pi/.node-red/node_modules/simple-get
decompress-response@4.2.1 /home/pi/.node-red/node_modules/decompress-response
mimic-response@2.1.0 /home/pi/.node-red/node_modules/mimic-response
simple-concat@1.0.1 /home/pi/.node-red/node_modules/simple-concat
tar-fs@2.1.1 /home/pi/.node-red/node_modules/tar-fs
chownr@1.1.4 /home/pi/.node-red/node_modules/chownr
tar-stream@2.2.0 /home/pi/.node-red/node_modules/tar-stream
bl@4.1.0 /home/pi/.node-red/node_modules/bl
buffer@5.7.1 /home/pi/.node-red/node_modules/buffer
base64-js@1.5.1 /home/pi/.node-red/node_modules/base64-js
ieee754@1.2.1 /home/pi/.node-red/node_modules/ieee754
readable-stream@3.6.0 /home/pi/.node-red/node_modules/bl/node_modules/readable-stream
fs-constants@1.0.0 /home/pi/.node-red/node_modules/fs-constants
readable-stream@3.6.0 /home/pi/.node-red/node_modules/tar-stream/node_modules/readable-stream
tunnel-agent@0.6.0 /home/pi/.node-red/node_modules/tunnel-agent
which-pm-runs@1.0.0 /home/pi/.node-red/node_modules/which-pm-runs
@serialport/parser-byte-length@9.0.7 /home/pi/.node-red/node_modules/@serialport/parser-byte-length
@serialport/parser-cctalk@9.0.7 /home/pi/.node-red/node_modules/@serialport/parser-cctalk
@serialport/parser-inter-byte-timeout@9.0.7 /home/pi/.node-red/node_modules/@serialport/parser-inter-byte-timeout
@serialport/parser-ready@9.0.7 /home/pi/.node-red/node_modules/@serialport/parser-ready
@serialport/parser-regex@9.0.7 /home/pi/.node-red/node_modules/@serialport/parser-regex
@serialport/stream@9.0.7 /home/pi/.node-red/node_modules/@serialport/stream
node-red-node-smooth@0.1.2 /home/pi/.node-red/node_modules/node-red-node-smooth
Now add the shortcut and start/stop/log scripts to the menu
Now add systemd script and configure it for pi
ln: failed to create symbolic link '/usr/bin/python': File exists
Now add launcher to top bar, add cpu temp example, make sure ping works
The user `pi' is already a member of `gpio'.
Memory : 531M
Finished : Sun 14 Mar 2021 01:45:53 PM EDT

***************************************

Started : Sun 14 Mar 2021 06:28:09 PM EDT
Running for user pi at /home/pi
Found global nodes:   :

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodered' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 94 not upgraded.
Already have nodejs v12.20.1
Now install nodejs

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodejs-legacy' is not installed, so not removed
Package 'nodejs' is not installed, so not removed
Package 'npm' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 94 not upgraded.
Versions: node:v12.20.1 npm:6.14.10
npm WARN using --force I sure hope you know what you are doing.
Now install Node-RED
npm WARN deprecated bcrypt@3.0.6: versions < v5.0.0 do not handle NUL in passwords properly
npm WARN deprecated node-pre-gyp@0.12.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated request@2.88.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated bcrypt@3.0.8: versions < v5.0.0 do not handle NUL in passwords properly
npm WARN deprecated node-pre-gyp@0.14.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future

Did this happen as soon as you started node-red for the first time?
I see you are using the RPI ! Model B - did you install buster with the desktop? It might be too much for that Pi.
Try this, stop node red using:

node-red-stop

and then start it using:

node-red-pi --max-old-space-size=256

And see if that will work.

If you haven't done too much with the Pi yes, I'd suggest reflashing the SD card using buster-lite and re running the node-red install script.

Could having the desktop installed give the errors seen there? Similarly, with an empty flows file I would not expect the max old space setting to make a difference on first startup.

I am wondering whether something in the current node-red or that version of nodejs is not compatible with such an old model of the Pi.

That is saying that there are very many system packages that need to be updated so I suggest running
sudo apt update && sudo apt full-upgrade
and reboot, to see if that helps.

Hi @borscht_bay

that is a very strange error from the internals of a module node-red depends on - not from node-red itself.

Could you run the following command and share the results?

npm ls -g content-type


Looking at the stack trace and the code in question, the express module is trying to call the parse function of the contentType object. contentType comes from a call to require('content-type').

For some reason, require('content-type') has returned an object that doesn't have the parse function - which is a mystery because the content-type module certainly does export the parse function.

Thank you all for your responses. I wound up having to fresh install Raspbian, running the update commands, and loading node red from terminal, without GUI system loaded. That solved the problem. I think maybe because my pi is so old the GUI might be too much.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.