3 ms·
> But still, having dealt with library version issues sometimes, I think "concurrent library versioning" and "sophisticated package management" sound awfully ni
by mikey_p 15y ago
> But still, having dealt with library version issues sometimes, I think "concurrent library versioning" and "sophisticated package management" sound awfully nightmarishly black-magic to me.
This isn't really much black magic to it, all the use cases are outlined in the docs: http://nodejs.org/docs/v0.6.3/api/modules.html#loading_from_node_modules_Folders http://nodejs.org/docs/v0.6.3/api/modules.html#loading_from_...
The bits that NPM does, is take advantage of the way node loads modules, and process dependencies recursively. For example take a look at how a few global modules are installed on my system:
$ npm ls -g
/usr/local/lib
├── bootstrap-stylus@0.2.0
├─┬ express@2.4.6
│ ├── connect@1.7.1
│ ├── mime@1.2.3
│ └── qs@0.3.1
This means that each of expresses dependencies, at the version listed, is installed into /usr/local/lib/node_modules/express/node_modules.
Also, by default npm installs into the current directory, or project which uses the same package.json format that modules themselves do. I find this to actually be the opposite of "black magic" since you use the same tools to manage your project at the top level, that is used to manage all your packages and dependencies.