It can be done using package managers too, for example using Nix. The problem here is not related to distribution method but rather dependency hell in javascriptland.
I want to like Nix, but it is far too pedantic to be practical. And this isn’t even mentioning the usability issues.