Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I list all globally installed npm packages using yarn?

Tags:

npm

yarnpkg

How do I list all globally installed npm packages using yarn?

I am new to yarn and to list all npm packages installed globally, I use npm list -g --depth=0 but is there a yarn equivalent?

like image 655
Alexander Avatar asked Jan 18 '17 07:01

Alexander


2 Answers

EDIT yarn global ls is now deprecated. It has been replaced with yarn global list instead.


TL;DR: yarn global ls

Longer answer: Use yarn global for any global related task. Consider yarn global a command as a whole, and not in terms of yarn + the suffix global as with npm + -g.

list does not work with yarn global (though it works with yarn at the local level). Use the short version ls instead. yarn global has no concept of depth either (though --depth=0 work for yarn at the local level).

For more details on yarn global: https://yarnpkg.com/en/docs/cli/global

like image 200
maevadevs Avatar answered Oct 19 '22 09:10

maevadevs


We should now use yarn global list since version 1.0.0 yarn global ls is deprecated.

v1.0.0 ! 🎉

like image 24
ricardoNava Avatar answered Oct 19 '22 07:10

ricardoNava