04 - Installing npm packages locally
Installing npm packages locally
There are two ways to install npm packages: locally or globally. You choose which kind of installation to use based on how you want to use the package.
If you want to depend on the package from your own module using something like Node.js' require
, then you want to install locally, which is npm install
's default behavior. On the other hand, if you want to use it as a command line tool, something like the grunt CLI, then you want to install it globally.
To learn more about the install
command's behavior, check out the CLI doc page.
Installing
A packa