balena-node-red-mqtt-nginx-TIG-stack
balena-node-red-mqtt-nginx-TIG-stack copied to clipboard
node-red nodes installed through `npm install` are lost when restarting/redeploying the node-red containers
E.g. in a Node-RED container I have installed node-red-contrib-math
by entering the following command
npm install bartbutenaers/node-red-contrib-math
This did successfully install the math node but when I restarted the container, I noticed that this node was no longer installed.
In order to assure that nodes installed through npm install
are not lost after a restart of the container, you must assure that they are installed in the \data
directory. So you must first do a cd \data
and then execute the npm install ....
command. This will assure that the node is correctly installed under folder \data\node_modules\
and that it will persist after restarts of the container.
I added the nodes I knew I wanted to the dockerfile in Node-red. and it worked great - now I dont have to worry about them disappearing.
I have also documented this in the readme under commit f1ef5770db7d8339e7d23184b057d1fe20a9b51c