I'm new to the node.js world and I was asking how I could handle dependencies versions conflics (which often appears with transitive dependencies): on the internet found only this article useful for me http://nodejs.org/api/modules.html#modules_addenda_package_manager_tips.
So it seems that i don't have to worry about conflicts because of how the packages are managed in node.js. Am I wrong, am I missing something? This seems strange (but still makes sense) to me, I'm used to handle dependencies with maven, setting the transitive dependencies that don't have to be downloaded.
Any help is appreciated, thank you.
npm and the node require
system will take care of this for you automatically. For example, your program can depend on dep1
and dep2
. dep1
can require subdep
version 1.0 and dep2
can require subdep
version 2.0, and npm will install multiple versions so each module gets the dependency versions it needs.
your-module/
node_modules/
dep1/
node_modules/
subdep/ (1.0)
dep2/
node_modules/
sudbep/ (2.0)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With