How to "recompile" a node?

Hello,
I have installed a node and I have customized it, modifying a bit its js file into the directory

/.node-red/node_modules/...

My question is simple. How can I recompile or install the modified software into node red?

Thanks,
Dan

When you change the code, you need the restart Node-RED.

While this approach is not recommend, it is working as long as you don't perform updates. :slightly_smiling_face:

1 Like

Clear thanks!

By the way, how can I perform updates, are they automatic or? Please advise.
Dan

Nothing will automatically update itself. It's up to you to update things when you want. How you do that will depend on what it is you are updating.

If you have manually changed code in node_modules, it will be overwritten if a new version of the module comes along and you do an update - either from within the palette manager in Node-RED or from the command line cd ~/.node-red && npm update.

To make your changes permanent, you need to "fork" the original module, make your changes in your fork and install your fork rather than the original. Of course, if you do that, your version will slowly get out of step with the original and given that the original may fix bugs, etc, that is probably not a good thing.

That's why the preferred approach is to talk to the original developer of the node and see if they are interested in your changes. If they are, you can create and amend your fork and then issue a "Pull Request". These are very badly named in my view because what you are really doing is asking to push your changes back into the original.

3 Likes