# Update of Nodes

**URL:** <https://discourse.nodered.org/t/update-of-nodes/93680>\
**Category:** Developing Nodes\
**Created:** [4 December 2024 10:46 UTC](https://discourse.nodered.org/t/update-of-nodes/93680 "2024-12-04T10:46:48Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![iiot2k](https://avatars.discourse-cdn.com/v4/letter/i/8baadc/32.png) [@iiot2k](https://discourse.nodered.org/u/iiot2k)\
**Post date:** [4 December 2024 10:46 UTC](https://discourse.nodered.org/t/update-of-nodes/93680/1 "2024-12-04T10:46:48Z")

</div>

When a Node-Red node is updated, are the node.js libraries used also updated?  
I updated my library [@iiot2k/gpiox - npm](https://www.npmjs.com/package/@iiot2k/gpiox) and used in Node-Red node [@iiot2k/node-red-gpiox - npm](https://www.npmjs.com/package/@iiot2k/node-red-gpiox).

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?

 ![update](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/7/3747b543f181e6b9111c8168be85c9d336220b98.png)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [4 December 2024 10:57 UTC](https://discourse.nodered.org/t/update-of-nodes/93680/2 "2024-12-04T10:57:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 December 2024 11:00 UTC](https://discourse.nodered.org/t/update-of-nodes/93680/3 "2024-12-04T11:00:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [4 December 2024 11:01 UTC](https://discourse.nodered.org/t/update-of-nodes/93680/4 "2024-12-04T11:01:02Z")

</div>

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

```auto
"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?

---

<div class="post-metadata">

**Author:** ![iiot2k](https://avatars.discourse-cdn.com/v4/letter/i/8baadc/32.png) [@iiot2k](https://discourse.nodered.org/u/iiot2k)\
**Post date:** [4 December 2024 11:04 UTC](https://discourse.nodered.org/t/update-of-nodes/93680/5 "2024-12-04T11:04:26Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/2/425f9c0862a5360e69c5c80af5d34e3cbefe74b6.png)

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/d/4dca39242dba5103584ef12d4385732e3583cb97.png)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [4 December 2024 11:04 UTC](https://discourse.nodered.org/t/update-of-nodes/93680/6 "2024-12-04T11:04:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 December 2024 11:07 UTC](https://discourse.nodered.org/t/update-of-nodes/93680/7 "2024-12-04T11:07:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![iiot2k](https://avatars.discourse-cdn.com/v4/letter/i/8baadc/32.png) [@iiot2k](https://discourse.nodered.org/u/iiot2k)\
**Post date:** [4 December 2024 11:12 UTC](https://discourse.nodered.org/t/update-of-nodes/93680/8 "2024-12-04T11:12:56Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/6/86ee6f2afe3d9f76bded7a52a515c63af89c2b28.png)

I found this in [node.js - How can I update each dependency in package.json to the latest version? - Stack Overflow](https://stackoverflow.com/questions/16073603/how-can-i-update-each-dependency-in-package-json-to-the-latest-version/16074029#16074029)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/b/5bf1f84a44b36b203ff28beaa9d16d920184e1ef.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 December 2024 11:19 UTC](https://discourse.nodered.org/t/update-of-nodes/93680/9 "2024-12-04T11:19:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![iiot2k](https://avatars.discourse-cdn.com/v4/letter/i/8baadc/32.png) [@iiot2k](https://discourse.nodered.org/u/iiot2k)\
**Post date:** [4 December 2024 11:27 UTC](https://discourse.nodered.org/t/update-of-nodes/93680/10 "2024-12-04T11:27:55Z")

</div>

Actual gpiox node ist 2.1.4

> **[@iiot2k/gpiox](https://www.npmjs.com/package/@iiot2k/gpiox)**
>
> Raspberry Pi gpiox library. Latest version: 2.1.4, last published: 16 hours ago. Start using @iiot2k/gpiox in your project by running \`npm i @iiot2k/gpiox\`. There are 4 other projects in the npm registry using @iiot2k/gpiox.

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

```C++
#define MODULE_VERSION "V2.2.1"

#ifdef TARGET_64

#define OUTTEXT "gpiox_arm64 " MODULE_VERSION

#else

#define OUTTEXT "gpiox_arm32 " MODULE_VERSION

#endif

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 December 2024 11:45 UTC](https://discourse.nodered.org/t/update-of-nodes/93680/11 "2024-12-04T11:45:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![iiot2k](https://avatars.discourse-cdn.com/v4/letter/i/8baadc/32.png) [@iiot2k](https://discourse.nodered.org/u/iiot2k)\
**Post date:** [4 December 2024 12:07 UTC](https://discourse.nodered.org/t/update-of-nodes/93680/12 "2024-12-04T12:07:00Z")

</div>

1. -\>  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/e/3ead6067d4be65dcb33864bc31254c8df67cac17.png)
2. 

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/6/f65d6e4c4be8c52ca0423fca6538b185da4e408c.png)  
This works:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/6/96e3951db9d945928713fb9d8eb9a676b1d18354.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/5/c566e94ede7da32c06f9049dc1864f16c6b37f40.png)

But this is not a solution for the palette manager.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 December 2024 12:16 UTC](https://discourse.nodered.org/t/update-of-nodes/93680/13 "2024-12-04T12:16:08Z")

</div>

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`)?

> [@iiot2k](#):
>
> This works:

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?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 December 2024 15:54 UTC](https://discourse.nodered.org/t/update-of-nodes/93680/14 "2024-12-04T15:54:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [2 February 2025 15:55 UTC](https://discourse.nodered.org/t/update-of-nodes/93680/15 "2025-02-02T15:55:19Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
