Strange enough node.js unlikely maven installs the packages the software needs inside the project directory.
Is there a way to introduce a central repository which also caches different versions of components and would allow to pull them on build like we know it from other ecosystems?
yarn replacement for
npm from Facebook does have a global per-user cache just like Maven does. The
node\_modules folder is not a cache, it is used by the software as its dependencies store.
just for curioisity, why wouldn't you place this as answer? (I would accept it). And, wouldn't npm -g allow for global package management as well, Maven-like?
npm -g would "install" packages in the global namespace, this is not the same as caching. Caching has all the various versions of each specific package, and when you need to install that specific version - it would use the cache instead of downloading the source over the internet. Actually installing the package globally doesn't have this property.
Didn't add this as the answer, since the question is very unclear to me. I don't understand exactly what the author wants to know, what you ask.
Common-features/differences described in detail here: https://stackoverflow.com/a/52745149/1555615