$ cd project_directory
If you already have the dependency in package.json file -> do
$ npm install
$ ./node_modules/.bin/<module-name> -V // to get the version
$ ./node_modules/.bin/<module-name> <action> // to use that module
else, if you want to install a new module, firstly do ->
$ npm install <module-name> --save-dev
and then use the commands to get the version and use the module. In this way you will be able to set up and use specific node_modules for a particular project which is a good practice and make your project easy to share.
To install modules globally, run ->
$ npm install -g <module-name>
or with sudo privileges ->
$ sudo npm install -g <module-name>
I hope this helps :) :)