20

Is there any way how to check directory/path of pnpm store?

I know you can set it with npm config set store /path/to/.pnpm-store, but npm config get store in my case returns undefined, which I guess means to pnpm to use some default, but where can I find this default value?

mauron85
  • 1,364
  • 1
  • 14
  • 28

5 Answers5

31

Nowadays you can do

pnpm store path

which, according to pnpm's documentation:

Returns the path to the active store directory.

The default locations of the store are:

  • If the $XDG_DATA_HOME env variable is set, then $XDG_DATA_HOME/pnpm/store
  • On Windows: ~/AppData/Local/pnpm/store
  • On macOS: ~/Library/pnpm/store
  • On Linux: ~/.local/share/pnpm/store

Related docs: https://pnpm.io/npmrc#store-dir

Zoltan Kochan
  • 5,180
  • 29
  • 38
foxesque
  • 590
  • 6
  • 12
17

Seems like as of v3.0.1, you cannot get it. pnpm should probably update pnpm get store so that it returns the default location.

As of v3, the pnpm store is located at ~/.pnpm-store by default.

You could also open the file node_modules/.modules.yaml in your project. It will contain a field called "store" with the location of the store that was used to hardlink packages to your project.

Update 2022:

As of v7, refer to @renardesque's or @nouvist's answer's below.

Zoltan Kochan
  • 5,180
  • 29
  • 38
14

previously, pnpm store is located on user home folder.

Linux   : ~/.pnpm-store
Windows : C:\Users\YOUR_NAME\.pnpm-store
macOS   : ~/.pnpm-store

but from now on (v7.0.0), pnpm store is located on different folder. it will located on $XDG_DATA_HOME on Linux, and %LOCALAPPDATA% on Windows. take a look to this issue.

Linux   : ~/.local/share/pnpm/store (default)
Windows : C:\Users\YOUR_NAME\AppData\Local\pnpm\store
macOS   : ~/Library/pnpm/store

or, you can check where is located with pnpm store path command

nouvist
  • 1,107
  • 10
  • 24
1

Possible locaiton:

  • ~/.pnpm-store
    If project is on the same partition as user home.
  • $partition_root/.pnpm-store
    If project is on different partition as user home.

Why not just use ~/.pnpm-store:

  • On linux/mac, pnpm use hard link to reuse file.
  • And hard link, can be created only on the same partition.
Eric
  • 22,183
  • 20
  • 145
  • 196
0

Content-addressable store is at: C:\Users\username\AppData\Local\pnpm\store\v3

Virtual store is at: node_modules/.pnpm

Dhanurjan
  • 81
  • 2
  • 8