Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

list all globally installed modules with one command in ubuntu

I'm working on ubuntu 14.04, Is there any way to print all global modules (installed using npm) to the command line. How can I do this?

like image 468
Muhsin Keloth Avatar asked Nov 14 '16 16:11

Muhsin Keloth


People also ask

What is the command used to list all modules that are installed globally?

Then you just use the npmlist command to get a formatted and color listing with versions of all global packages.

How do I view all installed packages globally?

Checking globally installed packages To check for all globally installed packages and its dependencies, run the npm list command followed by the -g flag.

How do I list all npm packages installed globally?

To view the npm global packages list and their dependencies, you can run the following npm list command followed by the “-g” flag where g stands for global. As you can see in the above result, all the global packages are displayed in a tree-like structure.

Where do I find global node modules?

On Unix systems they are normally placed in /usr/local/lib/node or /usr/local/lib/node_modules when installed globally. If you set the NODE_PATH environment variable to this path, the modules can be found by node.


2 Answers

The below command will list all your globally installed modules on Linux, Mac, and Windows.

npm ls -g --depth 0 
like image 76
Muhsin Keloth Avatar answered Oct 13 '22 04:10

Muhsin Keloth


To list all globally installed modules run:

npm ls -g --depth 0 

or yarn

yarn global ls --depth 0 

Extras:

To get a short module description run:

npm ll -g --depth 0 

To see the path of where the global modules are installed run:

npm ls -gp --depth 0 
like image 20
etoxin Avatar answered Oct 13 '22 05:10

etoxin