balena-node-red-mqtt-nginx-TIG-stack icon indicating copy to clipboard operation
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

Open janvda opened this issue 6 years ago • 3 comments

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.

janvda avatar Nov 22 '18 12:11 janvda

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.

janvda avatar Dec 12 '18 16:12 janvda

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.

diverjoe avatar Jan 29 '19 16:01 diverjoe

I have also documented this in the readme under commit f1ef5770db7d8339e7d23184b057d1fe20a9b51c

janvda avatar Jan 29 '19 16:01 janvda