Ishan Patel
Ishan Patel

Reputation: 6091

How do I check if specific dependency is installed using yarn?

Is there a way to check from Terminal if specific dependency (For example: Lodash) is installed in project or not using Yarn?

Upvotes: 3

Views: 4238

Answers (1)

mwoelk
mwoelk

Reputation: 1271

You can use the command yarn list [--depth] [--pattern].

For your example it would look like this: yarn list --pattern lodash. In this case it will not only look at dependencies specified in your package.json but in the whole dependency tree. So if you only want to check top-level dependencies you can add the flag --depth=0.

Details: https://yarnpkg.com/lang/en/docs/cli/list/

Upvotes: 9

Related Questions