For example if your project had this package.json file, running npm -install would create a node_modules sub-directory and install express and mocha into it:
It's also fairly common to install some modules globally, using npm -g, if they provide command-line utilities. For example, if you wanted to have jslint available to all users on your system, you'd do this:
sudo npm -g install jslint
which would place this in /usr/local/bin/jslint.
If you specify a dependency in your package.json file, and that module includes an executable -- like jslint, for example, or mocha -- then npm install will automatically place those executables in your project's node_modules/.bin directory. To make use of these, add this prefix to your $PATH in your ~/.bashrc file: