Help Wanted - testing updated install script

I started to prepare a revised version of settings.js that not only has better comments but that also adds some additional environment variables as standard overrides for things like ports, etc.

Not had a chance to pull the latest dev release and do a PR yet though.

The whole userDir gets created on first run and that is when the settings.js file is copied from the package. Not sure if that will take into account the port environment variable by default.

My alternate installer also has an example systemd service file that ensures that you can use a file in your userDir to provide the environment variables you might want. The file is optional so everything still works if it isn't present so it would be a safe adjustment for the default setup if @dceejay wanted to include it in his script.

1 Like

all Pull requests worth considering

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. :slight_smile: So I decided to do it again and keep notes. :slight_smile:
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:
NodeRED-Pre-Install
and the output of the update:
NodeRED-Post-Install

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

Well that is weird... it seems to install node14 ... and then reports node12...
can you tell me what which node reports ?

Well that is weird... it seems to install node14 ... and then reports node12...
can you tell me what which node reports ?

pi@PI-03-WC:~ $ which node
/usr/local/lib/nodejs/node-v12.16.3-linux-armv7l/bin/node
pi@PI-03-WC:~ $

pi@PI-03-WC:/usr/bin $ ll node*
-rwxr-xr-x 1 root root 67736724 May 11 14:11 node
lrwxrwxrwx 1 root root 24 May 27 07:28 nodejs -> /etc/alternatives/nodejs
lrwxrwxrwx 1 root root 35 May 27 07:30 node-red -> ../lib/node_modules/node-red/red.js
-rwxr-xr-x 1 root root 328 May 27 07:31 node-red-log
lrwxrwxrwx 1 root root 44 May 27 07:30 node-red-pi -> ../lib/node_modules/node-red/bin/node-red-pi
-rwxr-xr-x 1 root root 54 May 27 07:31 node-red-reload
-rwxr-xr-x 1 root root 99 May 27 07:31 node-red-restart
-rwxr-xr-x 1 root root 3419 May 27 07:31 node-red-start
-rwxr-xr-x 1 root root 228 May 27 07:31 node-red-stop
pi@PI-03-WC:/usr/bin $ ./node -v
v14.17.0
pi@PI-03-WC:/usr/bin $

Found it ....

jeez - how did it get in there ! hmm.

Pushed a fix back to the same place...

Bingo!


Thanks!

Is there something wierd with the script at the moment ?

I am attempting to run it as user pi on a Ubuntu 20.04 VM and keep getting

404 errors at line 1

Line 1 404 command not found

I am running

bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/v2/deb/update-nodejs-and-nodered) --node16 --update-nodes

I have tried changing node 16 to 14 and 12 - no difference.

System is currently running 1.3.4

Craig

I think that's an old URL from when Dave was working on it.

Try the one listed in the docs with your parameters

"Running on Raspberry Pi : Node-RED" Running on Raspberry Pi : Node-RED

1 Like

Yes sorry that was the v2 beta. I’ll tidy it up

thanks Steve - runnign now and looking good

Craig

Just wanted to update one of my virtual machines to NR 2.x. At first I was surprised that it didn't do anything with node10 and continued so I took a screenshot:

Shortly after that the script ran into an error:

@dceejay I don't mind update Node.js manually, but I could also leave it as it is and test a new version of the script if that would help.

Did you use the script linked at the start of this post or the proper one linked one the install page ?

Craig

I copied the script from here Running on Raspberry Pi : Node-RED a few seconds before execution.

Can you post the install log please.

Have you resolved the issue about the version of node.js? The latest version of node-red no longer supports node.js v10 I don't believe.

Hi @TotallyInformation, I am aware that node10 is not supported anymore, just wanted to report that I (presumably) found an error in the script.

most odd - it should indeed detect the node version being less than 12 and stop at that point unless you force it to use Node-RED version 1.

Are you running under any virtual manager ? like n or nvm ?

Not that I know of. I only use this computer for node-red... the initial installation and every update of node-red was done with by the script so there was no need to manually install anything.

I don't have access to the machine right now, I'll attach the log later today (after work).

The quick fix is to re run the command and add —node14 to the end. Which will then update that at the same time. But yes I would like to try to understand why it failed to tell you that in the first place.