Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list npm user-installed packages?

How do I list the user-installed / envirorment package ONLY in npm?

When I do npm -g list it outputs every package and their dependencies, instead I'd like to see the packages installed in the current working project or envirorment.

like image 874
lolski Avatar asked Jul 30 '13 03:07

lolski


People also ask

Where are npm global packages installed?

Path of Global Packages in the system: Global modules are installed in the standard system in root location in system directory /usr/local/lib/node_modules project directory. Command to print the location on your system where all the global modules are installed.

What is npm ls command?

Description. The npm ls command will print to stdout all the versions of a package that is installed, including their dependencies in a tree-structure. Positional arguments serve as name@version-range identifiers, which limits the results to the packages path alone.


1 Answers

npm list -g --depth=0 
  • npm: the Node package manager command line tool
  • list -g: display a tree of every package found in the user’s folders (without the -g option it only shows the current directory’s packages)
  • --depth 0 / --depth=0: avoid including every package’s dependencies in the tree view
like image 177
aris Avatar answered Sep 24 '22 06:09

aris