Question about namespacing
tnrich opened this issue · 2 comments
Say you name a local module 'lodash' and save it to your package.json. Then say you install the real lodash as a dependency. Does npm throw a namespace error when installing lodash? What about vice-versa where you create your local module and try to save it after already having lodash installed?
Also, do you know if this system breaks at all with npm3?
Thanks for your proof of concept and nice explanations. I think I'm leaning toward this approach as I like the more modular style of designing things that npm promotes.
I went ahead and carried out a little experiment to answer the first two questions I had. It turns out that npm installing either the local module version of lodash or the real lodash basically does nothing to the package.json if the other version is there to begin with.
Note that installing the real version of lodash still added it to the node_modules folder, just not to the package.json.
No warning were thrown at any point.
As for npm3, It performed the same as above for my very simple test case.
Sorry I just noticed this issue. I'm not sure I get what you're trying to achieve.
I doubt you shouldn't try to use both local and repository based version of a same library. Also switching from one to another through the CLI will probably not work (given how reliably npm handle usual situation, I doubt it'll behave correctly with such edge cases).