As of 13 December 2015
While I found the accepted answer 100% correct, and useful, I wished to expand upon it a little based on my own experiences, and hopefully for the benefit of others too. (Here I am using the terms package and module interchangeably)
In an answer to the question, yes the accepted answer would be:
You might wish to check for a particular module installed globally, on Unix-like systems or when grep is available. This is particularly useful when checking what version of a module you are using (globally installed; just remove the -g
flag if checking a local module):
npm list -g --depth=0 | grep <module_name>
If you'd like to see all available (remote) versions for a particular module, then do:
npm view <module_name> versions
Note, versions is plural. This will give you the full listing of versions to choose from.
For the latest remote version:
npm view <module_name> version
Note, version is singular.
To find out which packages need to be updated, you can use:
npm outdated -g --depth=0
To update global packages, you can use
To update all global packages, you can use:
(However, for npm versions less than 2.6.1, please also see this link as there is a special script that is recommended for globally updating all packages.)
The above commands should work across NPM versions 1.3.x, 1.4.x, 2.x and 3.x.