Tom Hale
Tom Hale

Reputation: 46745

Where does yarn keep global packages?

How do I find the directory where yarn keeps global packages?

What are the defaults, and how do I find the value based on current configuration?

Upvotes: 3

Views: 1635

Answers (1)

Tom Hale
Tom Hale

Reputation: 46745

The default global directories are:

  • $Env:LOCALAPPDATA/yarn/config/global/node_modules on Windows
  • ~/.config/yarn/global on OSX and non-root Linux
  • /usr/local/share/.config/yarn/global on Linux if logged in as root

This directory can be overridden by either npm or yarn's prefix, so to get the current value, use:

yarn global dir

Upvotes: 9

Related Questions