Problems with Raspberry Pi and Node Red

Hi all!

I have a few raspberry pie 3b out in the field running Node Red with standard Raspberry pi os with Node red. This has been working for a longer timer, but 2 of them went down after something updated automaticly. This was the same time as it stopped working.

After this i just get errors when i try to start or install node red.

Going over the log afterwards this is what i see.


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

Started : sø. 22. nov. 10:35:16 +0100 2020
Running for user pi at /home/pi
Found global nodes:   :

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

Leser pakkelister...
Skaper oversikt over avhengighetsforhold...
Leser tilstandsinformasjon...
Package 'nodered' is not installed, so not removed
Følgende pakker ble automatisk installert og er ikke lenger påkrevet:
  libexiv2-14 libgfortran3 libgmime-2.6-0 libncurses5 libssl1.0.2
  rpi-eeprom-images uuid-dev
Use 'sudo apt autoremove' to remove them.
0 oppgraderte, 0 nylig installerte, 0 å fjerne og 0 ikke oppgradert.
Already have nodejs v12.19.1
Now install nodejs
Versions: node:v12.19.1 npm:6.14.8
Now install Node-RED
npm WARN deprecated bcrypt@3.0.6: versions < v5.0.0 do not handle NUL in passwords properly
npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/nopt failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-11-22T09_52_01_344Z-debug.log
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 :
npm WARN node-red-project@0.0.1 No repository field.
npm WARN node-red-project@0.0.1 No license field.

+ node-red-node-pi-gpio@1.2.1
+ node-red-contrib-play-audio@2.5.0
+ node-red-node-random@0.2.0
+ node-red-node-smooth@0.1.2
+ node-red-node-serialport@0.11.1
+ node-red-node-ping@0.2.2
updated 6 packages in 7.105s
Now add the shortcut and start/stop/log scripts to the menu
Now add systemd script and configure it for pi
Now add launcher to top bar, add cpu temp example, make sure ping works
Brukeren «pi» er allerede et medlem av «gpio».
Memory : 1,0G
Finished : sø. 22. nov. 10:35:16 +0100 2020

Anyone knows what going on and how i can get node red working again?

That means you have some problem with your internet connection or dns server. If you connect to the pi and run
ping registry.npmjs.org
does it work?

Yes, that works.

Could it be that there is any autoupdates for Raspberry OS that is incompatible with node red?

What version of Raspbian are you using?
cat /etc/os-release

bilde

When i check status i also get this error:

Same version as the one that workes by the way.

Buster is good.
I think the best thing is to get rid of nodejs and npm and start again. This will not affect your flow file, but you have got that backed up of course anyway.
node-red-stop
sudo apt remove nodejs
sudo apt remove npm (it may not be installed separately so don't worry if this errors)
cd /usr/lib
sudo rm -rf node_modules
cd ~/.node-red
rm -rf node_modules
Now run the install script from the docs again
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

Did all the steps without any error, and when i tried to install node red again, it look really good as it took alot more longer time (as normal) and everything was checked out, but still the same error.

That's very odd. Do you get the same problem if you just run node-red?

If yes then can you post the install log for the most recent one please.

If i just type node-red then i get this error:
bilde

Here is the newest log:




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

Started : sø. 22. nov. 14:19:26 +0100 2020
Running for user pi at /home/pi
Found global nodes:   :

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

Leser pakkelister...
Skaper oversikt over avhengighetsforhold...
Leser tilstandsinformasjon...
Package 'nodered' is not installed, so not removed
Følgende pakker ble automatisk installert og er ikke lenger påkrevet:
  libexiv2-14 libgfortran3 libgmime-2.6-0 libncurses5 libssl1.0.2
  rpi-eeprom-images uuid-dev
Use 'sudo apt autoremove' to remove them.
0 oppgraderte, 0 nylig installerte, 0 å fjerne og 4 ikke oppgradert.
Now install nodejs
Updating nodejs 
Using nodesource.list
Removing nodejs v0

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

Leser pakkelister...
Skaper oversikt over avhengighetsforhold...
Leser tilstandsinformasjon...
Package 'npm' is not installed, so not removed
Package 'nodejs' is not installed, so not removed
Følgende pakker ble automatisk installert og er ikke lenger påkrevet:
  libexiv2-14 libgfortran3 libgmime-2.6-0 libncurses5 libssl1.0.2
  rpi-eeprom-images uuid-dev
Use 'sudo apt autoremove' to remove them.
0 oppgraderte, 0 nylig installerte, 0 å fjerne og 4 ikke oppgradert.

## Installing the NodeSource Node.js 12.x repo...


## Populating apt-get cache...

+ apt-get update
Funnet:1 http://archive.raspberrypi.org/debian buster InRelease
Funnet:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Funnet:3 https://deb.nodesource.com/node_12.x buster InRelease
Leser pakkelister...

## Confirming "buster" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_12.x/dists/buster/Release'

## Adding the NodeSource signing key to your keyring...

+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
Warning: apt-key output should not be parsed (stdout is not a terminal)
OK

## Creating apt sources list file for the NodeSource Node.js 12.x repo...

+ echo 'deb https://deb.nodesource.com/node_12.x buster main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src https://deb.nodesource.com/node_12.x buster main' >> /etc/apt/sources.list.d/nodesource.list

## Running `apt-get update` for you...

+ apt-get update
Funnet:1 http://archive.raspberrypi.org/debian buster InRelease
Funnet:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Funnet:3 https://deb.nodesource.com/node_12.x buster InRelease
Leser pakkelister...

## Run `sudo apt-get install -y nodejs` to install Node.js 12.x and npm
## You may also need development tools to build native addons:
     sudo apt-get install gcc g++ make
## To install the Yarn package manager, run:
     curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
     echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
     sudo apt-get update && sudo apt-get install yarn



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

Leser pakkelister...
Skaper oversikt over avhengighetsforhold...
Leser tilstandsinformasjon...
Følgende pakker ble automatisk installert og er ikke lenger påkrevet:
  libexiv2-14 libgfortran3 libgmime-2.6-0 libncurses5 libssl1.0.2
  rpi-eeprom-images uuid-dev
Use 'sudo apt autoremove' to remove them.
Følgende NYE pakker vil bli installert:
  nodejs
0 oppgraderte, 1 nylig installerte, 0 å fjerne og 4 ikke oppgradert.
MÃ¥ hente 0 B/16,2 MB med arkiver.
Etter denne operasjonen vil 86,4 MB ekstra diskplass bli brukt.
Selecting previously unselected package nodejs.
(Leser database ... 
(Leser database ... 5%
(Leser database ... 10%
(Leser database ... 15%
(Leser database ... 20%
(Leser database ... 25%
(Leser database ... 30%
(Leser database ... 35%
(Leser database ... 40%
(Leser database ... 45%
(Leser database ... 50%
(Leser database ... 55%
(Leser database ... 60%
(Leser database ... 65%
(Leser database ... 70%
(Leser database ... 75%
(Leser database ... 80%
(Leser database ... 85%
(Leser database ... 90%
(Leser database ... 95%
(Leser database ... 100%
(Leser database ... 151279 filer og kataloger er for øyeblikket installerte.)
Preparing to unpack .../nodejs_12.19.1-1nodesource1_armhf.deb ...
Unpacking nodejs (12.19.1-1nodesource1) ...
Setter opp nodejs (12.19.1-1nodesource1) ...
Processing triggers for man-db (2.8.5-2) ...
Versions: node:v12.19.1 npm:6.14.8
Now install Node-RED
npm WARN deprecated bcrypt@3.0.6: versions < v5.0.0 do not handle NUL in passwords properly
npm ERR! Unexpected end of JSON input while parsing near '...ist":{"integrity":"sh'

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-11-22T13_20_22_519Z-debug.log
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.2 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.19.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:270: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:314: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:363: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:409: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:430:28: warning: unnecessary parentheses in declaration of ‘ToParityEnum’ [-Wparentheses]
 SerialPortParity NAN_INLINE(ToParityEnum(const v8::Local<v8::String>& v8str)) {
                            ^
../src/serialport.cpp:449: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.19.1/include/node/node.h:727: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.19.1/include/node/node.h:761:3: note: in expansion of macro ‘NODE_MODULE_X’
   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
   ^~~~~~~~~~~~~
../src/serialport.cpp:483: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'

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

prebuild-install WARN install No prebuilt binaries found (target=12.19.1 runtime=node arch=arm libc= platform=linux)
make: Entering directory '/home/pi/.node-red/node_modules/modbus-serial/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:270: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:314: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:363: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:409: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:430:28: warning: unnecessary parentheses in declaration of ‘ToParityEnum’ [-Wparentheses]
 SerialPortParity NAN_INLINE(ToParityEnum(const v8::Local<v8::String>& v8str)) {
                            ^
../src/serialport.cpp:449: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.19.1/include/node/node.h:727: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.19.1/include/node/node.h:761:3: note: in expansion of macro ‘NODE_MODULE_X’
   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
   ^~~~~~~~~~~~~
../src/serialport.cpp:483: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/modbus-serial/node_modules/@serialport/bindings/build'

> serialport@9.0.2 postinstall /home/pi/.node-red/node_modules/serialport
> node thank-you.js

e[96me[1mThank you for using serialport!e[96me[1m
e[0me[96mIf you rely on this package, please consider supporting our open collective:e[22me[39m
> e[94mhttps://opencollective.com/serialport/donatee[0m



> serialport@8.0.8 postinstall /home/pi/.node-red/node_modules/modbus-serial/node_modules/serialport
> node thank-you.js

e[96me[1mThank you for using serialport!e[96me[1m
e[0me[96mIf you rely on this package, please consider supporting our open collective:e[22me[39m
> e[94mhttps://opencollective.com/serialport/donatee[0m



> node-red-contrib-modbus@5.13.3 postinstall /home/pi/.node-red/node_modules/node-red-contrib-modbus
> node ./supporter.js

e[96me[1mThank you for using our contribution!e[96me[1m
e[0me[96mIf you rely on this package, please consider supporting our open source work:e[22me[39m
> e[94mhttps://osi.bianco-royal.com/e[0m


npm WARN node-red-project@0.0.1 No repository field.
npm WARN node-red-project@0.0.1 No license field.

+ node-red-node-random@0.2.0
+ node-red-node-pi-gpio@1.2.1
+ node-red-node-smooth@0.1.2
+ node-red-contrib-play-audio@2.5.0
+ node-red-node-serialport@0.11.1
+ node-red-node-ping@0.2.2
added 112 packages from 105 contributors in 55.91s
Now add the shortcut and start/stop/log scripts to the menu
Now add systemd script and configure it for pi
Now add launcher to top bar, add cpu temp example, make sure ping works
Brukeren «pi» er allerede et medlem av «gpio».
Memory : 1,0G
Finished : sø. 22. nov. 14:19:26 +0100 2020

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

Started : sø. 22. nov. 14:22:44 +0100 2020
Running for user pi at /home/pi
Found global nodes:   :

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

Leser pakkelister...
Skaper oversikt over avhengighetsforhold...
Leser tilstandsinformasjon...
Package 'nodered' is not installed, so not removed
Følgende pakker ble automatisk installert og er ikke lenger påkrevet:
  libexiv2-14 libgfortran3 libgmime-2.6-0 libncurses5 libssl1.0.2
  rpi-eeprom-images uuid-dev
Use 'sudo apt autoremove' to remove them.
0 oppgraderte, 0 nylig installerte, 0 å fjerne og 4 ikke oppgradert.
Already have nodejs v12.19.1
Now install nodejs
Versions: node:v12.19.1 npm:6.14.8
Now install Node-RED
npm WARN deprecated bcrypt@3.0.6: versions < v5.0.0 do not handle NUL in passwords properly
npm ERR! Unexpected end of JSON input while parsing near '...ist":{"integrity":"sh'

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-11-22T13_22_57_937Z-debug.log
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 :
npm WARN node-red-project@0.0.1 No repository field.
npm WARN node-red-project@0.0.1 No license field.

+ node-red-node-ping@0.2.2
+ node-red-node-pi-gpio@1.2.1
+ node-red-node-random@0.2.0
+ node-red-node-serialport@0.11.1
+ node-red-contrib-play-audio@2.5.0
+ node-red-node-smooth@0.1.2
updated 6 packages in 7.898s
Now add the shortcut and start/stop/log scripts to the menu
Now add systemd script and configure it for pi
Now add launcher to top bar, add cpu temp example, make sure ping works
Brukeren «pi» er allerede et medlem av «gpio».
Memory : 1,0G
Finished : sø. 22. nov. 14:22:44 +0100 2020

Does the error when you run node-red mean command not found, or similar? For the future you can copy/paste out of a terminal using Ctrl+Shift+C and Ctrl+Shift+V rather than using screenshot.

If it does what does this command show
echo $PATH
and what happens if you run
/usr/bin/node-red

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games                                                                                                                           
-bash: /usr/bin/node-red: Ingen slik fil eller filkatalog                                                                                                                                                          

Please translate

No such file or file directory
So same error as just writing node red

Sorry, I am out of ideas. Perhaps @dceejay can help with this one.

1 Like

Other than re-installing Raspbian that is, then installing using the bash curl script, but hopefully there is another solution.

I dread this situation so I block internet access to the whole local Iot network and do an Isolated update at my convenience.

I am aiming to set up a local repo for pi updates and only update the repo after a verify that an internet update still leaves a working NR pi. When I get round to it that is.

Sorry I cannot add any more to your immediate situation. Please let us know your findings.