Alexander
Alexander

Reputation: 1829

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

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?

Upvotes: 13

Views: 5961

Answers (2)

maevadevs
maevadevs

Reputation: 219

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

Upvotes: 15

ricardoNava
ricardoNava

Reputation: 722

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

v1.0.0 ! 🎉

Upvotes: 12

Related Questions