Node-red-admin HELP! Installing a particular version of a node?

I am having trouble with 'node-red-contrib-mssql-plus' and others when it comes to connecting and working with multiple databases. There is a documented bug. There is no response from the owner of the node.

The problem began, possibly, on the advancement of 'node-red-contrib-mssql-plus'... I upgraded to the newest version some months ago. I was hoping to revert back to a prior version, if possible. I installed 'node-red-admin' which may allow an alternate installation tool through command line. Am I barking up the wrong tree? Perhaps.

I was looking at the documentation on 'node-red-admin' and it's not enough to answer the question of installing a back dated version of 'node-red-contrib-mssql-plus'.

Is it possible to install a back version of any node? Did I miss it in the documentation?

Thanks.

npm install <package>@<version>

2 Likes

Can you use this with node-red-admin?

You don't need to use node-red-admin

cd ~/.node-red
npm install node-red-contrib-mssql-plus@n.n.n

where n.n.n is the version you want to install.

Colin,
Thanks, Apparently 'node-red-admin' is limited to use as a remote tool. Since Node-RED editor has an installation dialog for the palette, I was wondering if the command line version had more functionality than the Node-RED dialog, (no options on installing nodes) and node-red-admin was preferred over 'npm' command line.

I could not find much on documentation on 'node-red-admin' other than a list of 'commands'.

I have had some issues in the past where I installed a node and then it could not update from the Node-RED palette dialog. I've had to uninstall and re-install using the Node-RED palette in order to have future access to "updates".

Kind Regards,

As long as you don't use root or install globally (-g) then it should be the same as using the built in manage palette. Only that doesn't let you pick versions. If you look at the log (when using the manage palette) you can see the command it is running.

Colin, All,

As it turns out, the root (of the original) problem has to do with ES6 and the Modules being cached. link to stackoverflow.com.
"Two key elements are at play here.

  1. Modules are cached after the first time they are loaded. This means that every call to require('./db') will return exactly the same object. The first require of db.js will run that file and create the promise and export it. The second require of db.js will return THAT same promise without running the file. And it's that promise that will resolve with the pool.
  2. A promise can be thenified again. And if it resolved before, it will immediately resolve again with whatever it resolved with the first time, which is the pool."

The installation of any older node isn't the solution. it's actually NodeJS. What we need to do is update the current MSSQL nodes (or have the author update...) behavior to force initialization of the connection each time you open a connection to another server.

Kind Regards,
Kyle

If you upgrade a node you must restart Node-RED to load the update. The module caching is just one small part of it.

This is why, if you click 'upgrade' on any node in the palette manager, we tell you to restart Node-RED to complete the upgrade.

Nick,
The cache referred here isn't installing a node. Installing an older working one was only a guess at resolving the main problem with MSSQL. its ES6 caching the configuration data used in a sql connection. If you connect to another database... then establish a once connected, other database, it uses the cache configuration data, thus generating errors because the expected tables and configuration now don't match.

Believe me, I always re-start Node-RED on installing any nodes.

Thanks,
Kyle

Just want to extend some thanks - your comment here, along with others over on GH saved my sanity when the latest version of node-red-node-serialport sent my dockerised RPi instance into a reboot loop. :raised_hands:

1 Like