Update of Nodes

When a Node-Red node is updated, are the node.js libraries used also updated?
I updated my library @iiot2k/gpiox - npm and used in Node-Red node @iiot2k/node-red-gpiox - npm.

In the package.json of Node-Red node is entered

"dependencies": {
"@iiot2k/gpiox": "latest"
}

I updated the Node-Red node with the palette manager, but the library used was not updated.
Am I doing something wrong?
How can I make sure that the library used is also updated?

I believe that, by default, if there is a package-lock.json, that will be used rather than package.json.

The lock file has specific dependency versions in it.

Can you post .node-red/package.json please?

I may be incorrect.
But specifying a base version will force it to update

"dependencies": {
   "@iiot2k/gpiox": "^2.1.4"
}

When updating my ZWave module, I always set the base version, and it gets updated.
Not sure using tags will have the same effect?

This is part in package-lock.json (/home/pi/.node-red/):

This is in package.json (/home/pi/.node-red/):

"*" would be the equivalent of "latest" I think., being a single wildcard.

Fom the .node-red directory, what does this show
npm list @iiot2k/gpiox

I found this in node.js - How can I update each dependency in package.json to the latest version? - Stack Overflow

So gpiox is actually 2.1.3. Where does gpiox_arm64 come into this?

Actual gpiox node ist 2.1.4

The gpiox driver (C++) has a internal version number:

#define MODULE_VERSION "V2.2.1"

#ifdef TARGET_64

#define OUTTEXT "gpiox_arm64 " MODULE_VERSION

#else

#define OUTTEXT "gpiox_arm32 " MODULE_VERSION

#endif

To understand how 'latest' works I suggest the following.

  1. In the .node-red folder run npm install to see if that updates the dependency (use npm list @iiot2k/gpiox to check what versions are installed).
  2. Remove it and reinstall - npm remove @iiot2k/node-red-gpiox then npm install @iiot2k/node-red-gpiox and check the versions again. Hopefully that should give the latest version.
  3. Remove it and install an earlier version then update, so remove as above, then install it, but using npm install @iiot2k/node-red-gpiox@2.1.3. Check the versions then update using npm updae @iiot2k/node-red-gpiox and check the versions again. However, because 'latest' is used then even installing the earlier version may install the latest of the dependency so it may not be possible to get back to the situation you had at the start.
  1. ->


This works:

But this is not a solution for the palette manager.

So removing and re-installing did not install the latest version of the dependency, but just kept using the already installed version? That seems very odd. What version of npm are you using (npm -v)?

So using npm update did fully update. I would have expected the palette manager to do exactly that, so it is odd that did not work.

What does the npm list command show now?

Slightly off at a tangent, if you need greater than a specific version then would it not be better to say that in the spec? Also you can then stop it from installing a later major version change which might, presumably, break things.