Why not always store packages at the top level, and create a directory for each version that's required?
For example: directory "A" contains two subdirectories: "v0.1.0" and "v0.1.1"
Why not always store packages at the top level, and create a directory for each version that's required?
For example: directory "A" contains two subdirectories: "v0.1.0" and "v0.1.1"
Changing the directory structure to encode versions is probably the Right Way in a grand sense, but it's a much more substantial change than just promoting packages by default.
It doesn't seem too big of a leap to do it the way I was suggesting.
Either bubble up and look for "node_packages", but this time store a symlink there, or add a dot file that tells you "this is where I found package.json".
I'm sure there was a reason they didn't go for either of those solutions because I've followed the team's discussions when they were iojs, and they have very smart people. I was just curious about the reasoning :)
I assumed the same team was in charge of both.
So resolving things at runtime is already happening.
I agree using package.json at runtime is not the best solution though.
A way to keep things clean and avoid using package.json is to use symlinks instead of downloading a fresh copy, which would make putting everything at the top level a possibility.
I'm sure that option was considered, but I'm curious about why it was not taken.
I suppose I should look at the discussion notes. Hope I'll remember to do that when I'm home!