IT:AD:Node.JS:Concepts:Local v. Global Packages

Summary

When ever you require packages, it looks in the local directory for a sub dir called node_modules.

If not found, searches recursively upwards for same folder, until found (or not).

Each Package that in turn requires other packages, will download the package in its directory – keeping everything completely separate. Nice!

It gets rid of global clashes.

So why use global? Becase some packages contain *.exes – which implies PATH, etc – and that's easier to manage in a global location.

Resources