Is it possible to install missing node types automatically?

I'm deploying to a new server, all my node-red flows;
Is it possible to install missing node types automatically? Or is there a way similar to installing npm packages, where it finds what modules are needed and installs them via npm install ?

Just curious if there is something internally in node-red that can "Seek and Deploy" these missing node types?

Hi .. im not an expert with npm but i think
if you copy the package.json file from the old server's .node-red folder
to the new system and run npm install (in .node-red folder) it should install all the missing nodes

1 Like

Ah! Yes!
That might work... Will try an report back.

Well... I tried, but I'm hitting issues because I decided to update to node-red 2.0.5, which requires a later version of node, which then I subsequently updated to version 16... but now I'm all messed up.

I assume your method works fine if I kept with the same versioning.

If you have changed the version of nodejs you also need to run npm rebuild so that it rebuilds the installed nodes for the new version.

1 Like

Not sure what is going on... The migration was actually going to an old server but trying to update and now the whole thing is virtually busted. This is because I was chasing a fix for an old node type objectid which was needed for mongodb on the old site... error stating its requires an old node version:

npm ERR! notsup Actual:   {"npm":"7.20.3","node":"v16.6.1"}```

I have unmet dependencies when trying to ```sudo apt-get install curl```,   when I install nodejs via:  ``` sudo apt-get install nodejs``` it doesn't make it available,  there is no ```node```, only a nodejs which seems to be the node interpreter, ```-bash: /usr/local/bin/npm: No such file or directory``` 

There is no symlink to any node... I try to execute node-red on port 443 (as node-red is the server to my website)   and must run this command to allow node to bind to port 443:
```sudo setcap CAP_NET_BIND_SERVICE=+eip /path/to/binary```  but errors:
```sudo setcap CAP_NET_BIND_SERVICE=+eip /usr/bin/nodejs
Failed to set capabilities on file `/usr/bin/nodejs' (Invalid argument)
The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file```

Not sure I have my ```sources.list``` file working, and and and and...

Yea... This is a real mess at this point.  I may just wipe the server instance and start over.
Unless someone has some magical instructions to fix many of these issues!  But I'm not sure it's worth the effort vs wiping.  There is nothing worth salvaging data wise on this server.

Start by running
sudo apt update && sudo apt full-upgrade
to try and fix the
sudo apt-get install curl

I get this still:

******@**********:~$ sudo apt update && sudo apt full-upgrade
Get:1 stretch-backports InRelease [91.8 kB]
Hit:2 stretch InRelease
Hit:3 cloud-sdk-stretch InRelease
Get:4 bionic-security InRelease [88.7 kB]
Hit:5 google-compute-engine-stretch-stable InRelease
Ign:6 stretch/mongodb-org/4.2 InRelease
Hit:7 bionic InRelease
Hit:8 bionic InRelease
Hit:9 google-cloud-packages-archive-keyring-stretch InRelease
Get:10 bionic-updates InRelease [88.7 kB]
Hit:11 stretch/mongodb-org/4.2 Release
Get:12 bionic-backports InRelease [74.6 kB]
Fetched 344 kB in 1s (306 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
3 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  default-mysql-server mysql-server php-curl
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
*********@*********:~$ sudo apt-get install curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 curl : Depends: libcurl4 (= 7.58.0-2ubuntu3.14) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.```

Where did you get that sources list from? You appear to have a mixture of Debian Stretch and Ubuntu Bionic sources.

This is nothing to do with node-red of course.

1 Like

Yes... We may need to move this to another thread, or mark the above solution.

I think I made a mistake somewhere late last night, and realized that what I thought was an Ubuntu setup was actually an old Debian setup. That might be where my tangle lies. :sleepy:

You may find it difficult to untangle the mess.

Wipe it shall be :slight_smile:
Thanks for your feedback!

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