=>2 Find the list of packages that we have installed globally

Sometimes we can't quite figure out if we have installed the packages locally or globally. To add to the agony we might not be sure if the script works because of our global package or the ones in package.json.

This is when we can find out if we have installed by just typing

npm list -g

this command will provide the list of the global package that we have installed on our machine. But there is one problem, it will give the list of packages that we have installed and the sub packages

To filter the list of global packages to the level that we need we have the option of restricting the results with depth

npm list -g --depth 0

or

npm list -g — depth=0

This command will filter the list that we actually installed.