Updating NR. What I thought should work doesn't

I know.......

I have had problems updating NR on my machines before and so when I finally got a definitive command, I saved it and used it to update all machines.

Said command:

bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)

Did that the other day on a RPI.

Nothing happened.

Still have 0.19.3

Can someone post what the definitive command is?
Slight hitch: Mostly for RPI, but also needs to accommodate NUC x86 machine running Ubuntu.

Ok, "definitive" may not be the exact word I want. But one which will update any/all of my machines.
If two commands are needed - one for RPI and one for NUC: fair enough.

What do you mean by nothing happened? Literally nothing or it went through the process but showed errors or it appeared to have worked but send to have had no effect? If the last one then post the install log. It tells you where it is at the end of the process.

Ok, forgive my brevity.

I logged in and cd .node-red Ran the command and it went about its fun.

AFAIK there weren't any warnings/errors which begged my attention.

I started node-red again with node-red-start and it went through no complaints.

But......
It didn't update the version.

Looking at the install log:

pi@TimePi:~ $ cat /var/log/nodered-install.log
pi@TimePi:~ $ ll /var/log/nodered-install.log
-rw-r--r-- 1 root root 0 Nov 25 06:25 /var/log/nodered-install.log
pi@TimePi:~ $ 

Nothing.

So that doesn't help.

So there is nothing hiding in the shadows, this is the process:

cd .node-red
node-red-stop
(the command)
node-red-start

For the sake of killing any other suspicion, I shall do it again now.
(Post of full results to come)

Ah!

Interesting.

Here is the results this time:

pi@TimePi:~ $ cd .node-red
pi@TimePi:~/.node-red $ node-red-stop

Stop Node-RED
 
Use   node-red-start   to start Node-RED again
 
pi@TimePi:~/.node-red $ bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)

 
This script will remove versions of Node.js prior to version 7.x, and Node-RED and
if necessary replace them with Node.js 10.x LTS (dubnium) and the latest Node-RED from Npm.
 
It also moves any Node-RED nodes that are globally installed into your user
~/.node-red/node_modules directory, and adds them to your package.json, so that
you can manage them with the palette manager.
 
It also tries to run 'npm rebuild' to refresh any extra nodes you have installed
that may have a native binary component. While this normally works ok, you need
to check that it succeeds for your combination of installed nodes.
 
To do all this it runs commands as root - please satisfy yourself that this will
not damage your Pi, or otherwise compromise your configuration.
If in doubt please backup your SD card first.
 
Are you really sure you want to do this ? [y/N] ? y

Running Node-RED update for user pi at /home/pi

This can take 20-30 minutes on the slower Pi versions - please wait.

  Stop Node-RED                       ✔
  Remove old version of Node-RED      ✔
  Remove old version of Node.js       -
  Leave existing Node.js              -   Node v8.12.0   Npm 6.4.1
  Clean npm cache                     -
  Install Node-RED core               ✔   0.20.3 
  Move global nodes to local          -
  Install extra Pi nodes              -
  Npm rebuild existing nodes          -
  Add shortcut commands               ✔
  Update systemd script               ✔
                                           

Any errors will be logged to   /var/log/nodered-install.log

All done.
  You can now start Node-RED with the command  node-red-start
  or using the icon under   Menu / Programming / Node-RED
  Then point your browser to localhost:1880 or http://{your_pi_ip-address}:1880

Started  Thu  4 Apr 18:45:33 AEDT 2019  -  Finished  Thu  4 Apr 18:54:23 AEDT 2019

pi@TimePi:~/.node-red $ cat /var/log/nodered-install.log

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

Started : Thu 4 Apr 18:45:33 AEDT 2019
Running for user pi at /home/pi
Found global nodes:   :
Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodered' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  coinor-libipopt1v5 libexiv2-14 libgmime-2.6-0 libgpgme11 libmumps-seq-4.10.0
  libraw15 wolframscript
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
/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@2.0.1 install /usr/lib/node_modules/node-red/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v2.0.1/bcrypt_lib-v2.0.1-node-v57-linux-arm-glibc.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for bcrypt@2.0.1 and node@8.12.0 (node-v57 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
  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'
+ node-red@0.20.3
added 387 packages from 342 contributors in 371.995s
0.20.3 
The user `pi' is already a member of `gpio'.
Finished : Thu 4 Apr 18:45:33 AEDT 2019
pi@TimePi:~/.node-red $ 


Note the line:
Package 'nodered' is not installed, so not removed

I'll put my hand up and say "I don't understand that!"
Node -red is installed. I am/was using it.

So, what now?

One of the steps the script takes is to remove the nodered package that was installed via apt-get so it can then use npm to install the latest.

The message is simply saying the apt-get installed package isn't there so it doesn't need to remove it.

Further on you can see if has installed the latest:

+ node-red@0.20.3

When you run node-red-start what version does it report in its log output?

Sorry Nick, I see you are replying.

But looking further into it I see this:

node-pre-gyp ERR! Tried to download(404): https://github.com/

That can't be good.

It isn't ideal, but it is not a fatal error - the bcrypt module is an optional dependency which is allowed to fail.

Ok, thanks Nick.

I know this is going to make me look stupid. But I can't be a complete idiot: bits are missing.
(Attempt at light hearted humour)

pi@TimePi:~/.node-red $ node-red-start

Start Node-RED
 
Once Node-RED has started, point a browser at http://192.168.0.99:1880
On Pi Node-RED works better with the Firefox or Chrome browser
 
Use   node-red-stop                          to stop Node-RED
Use   node-red-start                         to start Node-RED again
Use   node-red-log                           to view the recent log output
Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot
 
To find more nodes and example flows - go to http://flows.nodered.org
 
Starting as a systemd service.
Started Node-RED graphical event wiring tool.
4 Apr 19:01:15 - [info]
Welcome to Node-RED
===================
4 Apr 19:01:15 - [info] Node-RED version: v0.20.3
4 Apr 19:01:15 - [info] Node.js  version: v8.12.0
4 Apr 19:01:15 - [info] Linux 4.14.79+ arm LE
4 Apr 19:01:20 - [info] Loading palette nodes

And looking on the web page it is also 0.20.3.

Honestly: I didn't do anything different than the other night.

Granted I didn't study the version when I started node-red after the update.

(Falls on own sword.)

Sorry everyone.

I honestly don't like making false claims. Last night I tried, it didn't work. Today, it did.

There's no need to stop node-RED when updating, just run the script and it's clever enough to sort that itself.

Thanks Paul.

I do it only because I have some RPZ(W) and they are running a bit hard compared to the 2's and 3's I have.

So as a matter of course, I stop node-red only to lower processor load as much as possible.

I think it makes life easier on the RPI while it is updating, not having to run NR in the background.

The script will stop it anyway so no need

1 Like

Thanks.

Noted.