Hacker News new | ask | show | jobs
by tarruda 2214 days ago
One thing node.js got right is the module resolution logic.

Node doesn't even need something like venv since module lookup is always local.

Also no problem with dependency hell. Each dependency can have its own private dependencies, even different versions of dependencies shared by sibling modules. Tools like yarn/npm can remove duplicates across a project.

3 comments

It's a lot more of a pressing concern when you have an average of 1,200 dependencies per project.

(I'm actually not sure if it is the average but my anecdotal experience is that it's an order of magnitude higher than python, and 1200 wouldn't be unusual).

That's probably quite accurate for front-end projects which pull in a ton of packages for 1. A compatibility layer wih older browsers. 2. Build tooling.

Node projects tend to have a lot smaller dependency graphs.

Yes we all learned that virtual envs are not the right way to do it. Node definitely got this portion right.

I wish Python can abandon virtual envs. This is the most annoying part of setting up a project.

How come other tools don't just replicate successful models?