I had previously installed node v12.x and Node-RED v 1.1.0 on my Pi3B+, when I ran it I used the --node14
and --restart
switches it ran but did not update my version of node, it reported my current version and a check showed up that said it replaced it but showed my current version again when it completed, and it did not restart. I wish I would have captured a screenshot post install but I switched into debug mode instead of documenting mode. So I decided to do it again and keep notes.
Here is my script to get and run the new NodeRED Installer.
#!/bin/bash
mv ~/Downloads/NodeRED-Installer ~/Downloads/NodeRED-Installer.OLD
touch ~/Downloads/NodeRED-Installer
curl -sL https://raw.githubusercontent.com/node-red/linux-installers/v2/deb/update-nodejs-and-nodered > ~/Downloads/NodeRED-Installer
chmod +x ~/Downloads/NodeRED-Installer
~/Downloads/NodeRED-Installer --node14 --restart
Here is my pre installer commands:
and the output of the update:
Here is the log file (thined out a little due to length):
Already have nodejs v12.16.3
OLD nodejs 12 :
NEW nodejs 14 :
***************************************
Started : Thu 27 May 2021 07:25:44 AM CDT
Running for user pi at /home/pi
Found global nodes: :
WARNING: apt ...
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 200 not upgraded.
Already have nodejs v12.16.3
OLD nodejs 12 :
NEW nodejs 14 :
***************************************
Started : Thu 27 May 2021 07:26:39 AM CDT
Running for user pi at /home/pi
Found global nodes: :
WARNING: apt ...
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 200 not upgraded.
Installing nodejs 14
WARNING: apt ...
Reading package lists...
Building dependency tree...
Reading state information...
Package 'npm' is not installed, so not removed
The following packages will be REMOVED:
nodejs
0 upgraded, 0 newly installed, 1 to remove and 200 not upgraded.
After this operation, 114 MB disk space will be freed.
(Reading database ...
(Reading database ... 100%
(Reading database ... 161344 files and directories currently installed.)
Removing nodejs (14.17.0-1nodesource1) ...
dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator' not empty so not removed
Processing triggers for man-db (2.8.5-2) ...
dpkg: warning: ignoring request to remove nodejs which isn't installed
dpkg: warning: ignoring request to remove node which isn't installed
WARNING: apt ...
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 200 not upgraded.
Grab the LTS bundle
WARNING: apt ...
Reading package lists...
Building dependency tree...
Reading state information...
curl is already the newest version (7.64.0-4+deb10u2).
0 upgraded, 0 newly installed, 0 to remove and 200 not upgraded.
## Installing the NodeSource Node.js 14.x repo...
## Populating apt-get cache...
+ apt-get update
Hit:1 https://deb.nodesource.com/node_14.x buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Hit:3 http://raspbian.raspberrypi.org/raspbian buster InRelease
Reading package lists...
## Confirming "buster" is supported...
+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_14.x/dists/buster/Release'
## Adding the NodeSource signing key to your keyring...
+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodesource.gpg >/dev/null
gpg: WARNING: unsafe ownership on homedir '/home/pi/.gnupg'
## Creating apt sources list file for the NodeSource Node.js 14.x repo...
+ echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x buster main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x buster main' >> /etc/apt/sources.list.d/nodesource.list
## Running `apt-get update` for you...
+ apt-get update
Hit:1 https://deb.nodesource.com/node_14.x buster InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:3 http://archive.raspberrypi.org/debian buster InRelease
Reading package lists...
## Run `sudo apt-get install -y nodejs` to install Node.js 14.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 | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] 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 ...
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
nodejs
0 upgraded, 1 newly installed, 0 to remove and 200 not upgraded.
Need to get 22.8 MB of archives.
After this operation, 114 MB of additional disk space will be used.
Get:1 https://deb.nodesource.com/node_14.x buster/main armhf nodejs armhf 14.17.0-1nodesource1 [22.8 MB]
Fetched 22.8 MB in 13s (1,779 kB/s)
Selecting previously unselected package nodejs.
(Reading database ...
(Reading database ... 100%
(Reading database ... 156430 files and directories currently installed.)
Preparing to unpack .../nodejs_14.17.0-1nodesource1_armhf.deb ...
Unpacking nodejs (14.17.0-1nodesource1) ...
Setting up nodejs (14.17.0-1nodesource1) ...
Processing triggers for man-db (2.8.5-2) ...
Versions: node:v12.16.3 npm:6.14.4
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 ...
npm WARN deprecated node-pre-gyp@0.12.0: ...
npm WARN deprecated request@2.88.0: ...
npm WARN deprecated har-validator@5.1.5 ...
npm WARN deprecated bcrypt@3.0.8: versions < v5.0.0 ...
npm WARN deprecated node-pre-gyp@0.14.0: ...
/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-v83-linux-arm-glibc.tar.gz
node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.6 and node@14.17.0 (node-v83 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/14.17.0/include/node/node.h:758: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/14.17.0/include/node/node.h:792: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
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.8/bcrypt_lib-v3.0.8-node-v83-linux-arm-glibc.tar.gz
node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.8 and node@14.17.0 (node-v83 ABI, glibc) (falling back to source compile with node-gyp)
make: Entering directory '/usr/lib/node_modules/node-red/node_modules/node-red-admin/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:2298: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:54,
from ../src/bcrypt_node.cc:1:
../src/bcrypt_node.cc: At global scope:
/root/.cache/node-gyp/14.17.0/include/node/node.h:758: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/14.17.0/include/node/node.h:792:3: note: in expansion of macro âNODE_MODULE_Xâ
NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
^~~~~~~~~~~~~
../src/bcrypt_node.cc:359: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/node-red-admin/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/node-red-admin/node_modules/bcrypt/build'
+ node-red@1.3.5
added 350 packages from 316 contributors in 134.763s
Now create basic package.json for the user and move any global nodes
Running npm rebuild
> @serialport/bindings@9.0.8 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.16.3 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:13,
from ../src/serialport.cpp:1:
/home/pi/.cache/node-gyp/12.16.3/include/node/node.h:608: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.16.3/include/node/node.h:642: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-camerapi@0.0.39 /home/pi/.node-red/node_modules/node-red-contrib-camerapi
fs@0.0.1-security /home/pi/.node-red/node_modules/fs
... Many lines omitted because this part worked ...
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 : 973M
Started : Thu 27 May 2021 07:26:39 AM CDT
Finished: Thu 27 May 2021 07:31:56 AM CDT