People have been running servers and installing software for a long time before Docker came around, and will be for a long time after it's flavour of the month appeal wears off.
npm already installs dependencies locally by default.
I already generally avoid Java apps, for bigger reasons than packaging, but setting a custom $CLASSPATH for the JVM to load your dependencies isn't really that difficult.
Good luck when you want to have multiple projects installed on a single server.