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.