Not having any luck updating

Ok. I get that.

I am doing a lot of catch up on the replies.

The second part:
That was what I was meaning......
Use the npm install package@version command to do that for each module in turn

So if I have (example) node foo and it is version 0.0.1 and in the manger it says 0.0.4 if available, and I am not having any luck updating it with:
npm install foo
I could try
npm install foo@0.0.4

I'll stop here because it seems I have more replies to read.
(Not meaning I don't appreciate the help.)
I just want to keep up to date and not post what doesn't need to be posted.

I take back what I said - you are right Julian.

Running npm install foo will:

  1. if it is already listed in package.json, install the version that satisfies the version in the package.json.
  2. if it is not listed in package.json, install the latest version and add an entry to package.json
1 Like

Ok.

I am getting it. Slowly.

So, I am surmising that something I have installed was out of date and prevented the other nodes updating?

Since I have (or seem to) got it updated, they are updating now easier.

For the sake of it, this is what npm outdated gives me:

pi@TimePi:~/.node-red $ npm outdated
Package                         Current  Wanted  Latest  Location
node-red-contrib-bigtimer         2.1.1   2.1.3   2.1.3  node-red-project
node-red-contrib-browser-utils    0.0.7   0.0.7   0.0.8  node-red-project
node-red-contrib-cpu              0.0.2   0.0.2   0.0.4  node-red-project
node-red-contrib-play-audio       2.3.1   2.3.2   2.3.2  node-red-project
node-red-contrib-pythonshell      1.4.3   1.4.3   1.5.4  node-red-project
node-red-contrib-timeout          1.0.7   1.0.8   1.1.1  node-red-project
node-red-node-ledborg            0.0.19  0.0.19  0.0.21  node-red-project
node-red-node-pi-sense-hat       0.0.15  0.0.15  0.0.18  node-red-project
node-red-node-ping               0.0.15  0.0.15  0.0.16  node-red-project
node-red-node-random              0.1.0   0.1.2   0.1.2  node-red-project
node-red-node-serialport          0.6.5   0.6.8   0.6.8  node-red-project
node-red-node-suncalc            0.0.10  0.0.10  0.0.11  node-red-project
pi@TimePi:~/.node-red $ 

So, I have already tried to update:
node-red-contrib-cpu
node-red-contrib-pythonshell
to no avail.

Is it worth trying again after this bit of luck?

The others aren't really important/used so not of too much concern.

You did have something out of date, but it would not have been preventing the others.

What command did you run to try to update them?

Originally I did it from the web/palette thingy.

It sat there and said it was done, but it wasn't.
(P.S. The message isn't showing it is updated either. But that could be another outdated thing else where.)

So I tried a few times. Wasn't happening.
(WIth node-red restarts or machine reboots)

I then fell back to CLI install with the command:
npm install ....... (name of node)
It would come up with the messages and I would restart and the number wasn't updated.

I kept on trying (probably) only out of stupidity.
Weirdly the dashboard did update somewhere along the line. Dunno how or why.

(I know I have been told. How do I get the history of commands? The file)

Have you tried running the command I gave you a couple replies ago that you said worked for one module?

npm install name@version

For example:

npm install node-red-contrib-bigtimer@2.1.3

No,

I (we?) kind of got distracted.

I was going to ask for "confirmation" about it. I did hint at doing that.

Standby and I'll post results.

Please can everyone contributing to this thread take note of this.

When we're working towards a solution, swooping in with some alternative command to run without explanation or consideration of the ongoing conversation can be highly counterproductive.

Um....

Updating the nodes is not a "2 second job". It can take a few minutes.

Gotta love Australian ADSL speeds.

This is the first of the list I just posted being updated:

pi@TimePi:~/.node-red $ npm install node-red-contrib-bigtimer@2.1.3
npm WARN node-red-project@0.0.1 No repository field.
npm WARN node-red-project@0.0.1 No license field.

+ node-red-contrib-bigtimer@2.1.3
updated 1 package and audited 875 packages in 231.62s
found 6 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
pi@TimePi:~/.node-red $ 

Shall restart NR and see what happens.

Ok, that was big-timer.

I forgot to include in the cut/paste this part:

pi@TimePi:~/.node-red $ sudo systemctl restart nodered
pi@TimePi:~/.node-red $ 

Alas:

It is still showing 2.1.1

But is that earlier post really relevant?

Hang on and I'll check the .json data

Um..... Can't find where it is.

Sorry.

pi@TimePi:~/.node-red/node_modules/node-red-contrib-bigtimer $ tail package.json 
  "node-red": {
    "nodes": {
      "bigtimer": "bigtimer.js"
    }
  },
  "repository": {
    "private": true
  },
  "version": "2.1.3"
}
pi@TimePi:~/.node-red/node_modules/node-red-contrib-bigtimer $ 

Seems the GUI is not keeping up with the actual .json version.

Ok, so bigtimer has updated in ~/.node-red/node_modules but node-red appears to still find the old one.

Next task: look for an entry for bigtimer in ~/.node-red/.config.json. That will include the full path to where it has been loaded from. Please share that entry here (the full bigtimer entry, not just the path field).

I've included a bit prior to what you asked to answer the path question.

pi@TimePi:~/.node-red/node_modules/node-red-contrib-bigtimer $ tail package.json 
  "node-red": {
    "nodes": {
      "bigtimer": "bigtimer.js"
    }
  },
  "repository": {
    "private": true
  },
  "version": "2.1.3"
}
pi@TimePi:~/.node-red/node_modules/node-red-contrib-bigtimer $ cd ~
pi@TimePi:~ $ cd .node-red
pi@TimePi:~/.node-red $ cat .config.json | grep bigtimer
  "node-red-contrib-bigtimer": {
   "name": "node-red-contrib-bigtimer",
    "bigtimer": {
     "name": "bigtimer",
      "bigtimer"
     "module": "node-red-contrib-bigtimer",
     "file": "/home/pi/.node-red/node_modules/node-red-contrib-bigtimer/bigtimer.js"
pi@TimePi:~/.node-red $ 

Is that what you wanted?

Very close. Using grep has filtered out the lines from the bigtimer section of .config.json that don't mention bigtimer... such as the version :slight_smile:

But it does show us the file entry points to the 'right' place under .node-red. If you could go into the .config.json file and check what the version value is that would be great.

I hope this is it.
(Big file. Had to.... anyway.)

  "node-red-contrib-bigtimer": {
   "name": "node-red-contrib-bigtimer",
   "version": "2.1.3",
   "local": true,
   "nodes": {
    "bigtimer": {
     "name": "bigtimer",
     "types": [
      "bigtimer"
     ],
     "enabled": true,
     "local": true,
     "module": "node-red-contrib-bigtimer",
     "file": "/home/pi/.node-red/node_modules/node-red-contrib-bigtimer/bigtimer.js"
    }
   }

I would attach the file, but it isn't the right "file type".

Actually sorry.... But where is the attach FILE button. I can only seem to find attach picture.

config.json (32.2 KB)

Oh well, that worked.

Just in case I missed something else.

Thanks - so that shows us that node-red has loaded version 2.1.3 of the node. Good.

  1. are you sure you've reloaded the editor in your browser?
  2. are you sure you are looking at the editor from the right Raspberry Pi?

There is no caching of these version numbers in the editor - it asks the runtime what it has loaded each time.

I restarted NR - that was shown in the second post.

I know it did restart because it comes up with the "connection lost" message.

You can see the IP address is .99 from the screen shots.

I will reboot it now.

Hang on.