How to set PERL5LIB for node-red?

Just to follow up. Your response inspired the following tests (after saving my sorted user environment in a file on the command line):

[{"id":"81ea3e84.bb722","type":"exec","z":"8b5ff0a3.decbe8","command":"env | sort | diff /home/pi/tmp.env - && exit 0","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"diff env file","x":250,"y":80,"wires":[["95bc6e3b.ff0d48","369ad5ad.dc0352"],["95bc6e3b.ff0d48"],["95bc6e3b.ff0d48"]]},{"id":"95bc6e3b.ff0d48","type":"debug","z":"8b5ff0a3.decbe8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":450,"y":60,"wires":[]},{"id":"71c6a30f.42003c","type":"inject","z":"8b5ff0a3.decbe8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":80,"wires":[["81ea3e84.bb722"]]},{"id":"369ad5ad.dc0352","type":"file","z":"8b5ff0a3.decbe8","name":"","filename":"/home/pi/tmp.nr.env.update.diff","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"none","x":510,"y":100,"wires":[[]]},{"id":"f542aff2.b9cc18","type":"inject","z":"8b5ff0a3.decbe8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":180,"wires":[["3c26a4e4.3455d4"]]},{"id":"3c26a4e4.3455d4","type":"exec","z":"8b5ff0a3.decbe8","command":"perl -e 'use DateTime'","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"perl module env test","x":280,"y":180,"wires":[["33ed4241.31df7e"],["33ed4241.31df7e"],["33ed4241.31df7e"]]},{"id":"33ed4241.31df7e","type":"debug","z":"8b5ff0a3.decbe8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":470,"y":180,"wires":[]}]

Looks like to get the environment, I need to add the --update-env option to pm2.

Thanks for following up.

1 Like