Raspberry pi outdated software

I use the command npm outdated -g --depth=0 on my rpi to check if I have outdated software.

It turns out my 'corepack' is outdated. This package seems not to be getting updated with the usual APT commands. I also cannot find anything about this package on internet.

Can anyone tell me what this is? And how do I update this package?

afbeelding

afbeelding

I think that is the module corepack. This page says it is installed with nodejs, so there is probably not much you can do about it, other than upgrade nodejs I suppose.

1 Like

@Colin OK, so I understand that is some kind of development tool, I do not really need, but I got somehow for free lately? :slight_smile: Thanks for the info Colin!

According to that page it doesn't do anything unless you activate it, so I wouldn't worry about it.

1 Like

The reason it wasn't updated is that your package.json is specifying that it wants anything in the 0.14.* range of versions. So 0.15.2 is outside that.

Note that versioning standards for npm make the assumption that anything with a major version change (e.g. v1.2.3 to v2.0.0) is a breaking change and therefore should not update automatically.

However, before v1, it is assumed that minor version changes may also be breaking so changing from v0.14.x to v0.15.x may be breaking and does not auto update.

1 Like

@TotallyInformation I t might have something to do that I upgraded node.js from version 15.x to version 16.x.

I don't think I really need it, do I? So what advice can you give me, update somehow to version 16.x also, or de-install the package?

Corepack will let you use Yarn and pnpm without having to install them

Unless you need it, you don't need it! :slight_smile:

It is only useful when using Yarn or pnpm anyway so if you aren't using those, you don't need it. And it is only useful if creating packages using those tools.

1 Like

@TotallyInformation OK, so I guess I don't need it then.

Can I with a simple NPM uninstall corepack remove this package?

From the correct folder, yes. Looks like it was a global install so from any location, just remember to include -g in the parameters.

1 Like

@TotallyInformation Ok, seems good.

sudo npm uninstall corepack -g

Did do the trick. Thanks for your help. :slight_smile:

1 Like

@TotallyInformation @Colin I have another question in regard to outdated software.

Is there a way to detect if there is a new node red dashboard version. It would like to update my software overview with that. Now I check my node-red manage pallet manually, to see if there is a new version.

I think I have a flow for that but I'm struggling to find it.

If I remember rightly, I use an exec node to issue an npm command which gets captured and sends a message to telegram if there is anything to update.

This will tell you if Dashboard needs updating:

npm outdated --json node-red-dashboard

The data returned is in JSON format.

Outside of Node-RED you can go into your .node-red directory and run npm outdated to see if there are any upgrades available. Then npm upgrade will update the ones that it can safely. (Some you may need to do manually if there is too big a semantic jump - so you need to check what breaking changes may affect you). Then you can restart Node-RED.

@dceejay I use npm outdated -g --depth=0 to detect if there are new versions, but it doesn't include new versions of dashboard, as far as I know. My installed version now is 3.2.0, but I just saw there is a new version 3.2.3. But npm outdated doesn't report anything.

That is checking global installs and you will have installed dashboard locally. remove the -g and the --depth=0 and make sure you are in your userDir folder when issuing the command.

@TotallyInformation That doesn't seem right...

afbeelding

The directory you want is the one where the flows are located, which is usually called .node-red

1 Like

@Colin @TotallyInformation @dceejay

Well, I managed so far with following command:

cd /home/pi/.node-red && npm outdated node-red-dashboard --json

I get this output:

1 Like

You will get an empty JSON string {} if there is no outstanding update. Also note that wanted and latest will be different if there is a major version change waiting. Otherwise, they should be the same.

@TotallyInformation

Yes, I know that already. I only use this command to check for outdated software, not for current version.
Indeed, I only check for latest, not wanted!

For current version I use command:

cd /home/pi/.node-red && npm list node-red-dashboard --depth=0 --json