Use as few deps as possible, and run your projects in containers, or even better, VMs.
That doesn't guarantee anything still, that's the beauty of Javascript ;)