Skip to content

Instantly share code, notes, and snippets.

@zkochan
Last active Nov 2, 2021
Embed
What would you like to do?
Question on Gitter about pnpm hard links

back to pnpm

original thread happened on 2017 Jun 13 11:49: https://gitter.im/pnpm/pnpm?at=593fa6fd6549436c7d41f4c9

@marxus85:
hey .. there is something i dont get
on windows 10.. i've got this folder %userprofile%.pnpm-store\1\registry.npmjs.org
which contains the extracted modules.
and when i do pnpm i -g <something>, it creates another folder which is ".registry.npmjs.org" which contains the extracted modules
and when i open another folder for a new project and do pnpm i <something> i get another ".registry.npmjs.org" folder which contains the extracted modules.
none of them are linked
so... in the end it do get 3 times of the same module

@zkochan:
hey, if you check the ino numbers of the files inside those folders, you'll see that they are the same in all 3 folders they are on the same location on the disk
https://github.com/pnpm/pnpm#why-does-my-node_modules-folder-use-disk-space-if-packages-are-stored-in-a-global-store

@marxus85:

1125899907199372 drwx------+ 1 0 Jun 13 11:08 registry.npmjs.org
10133099161699660 drwx------+ 1 0 Jun 13 11:54 .registry.npmjs.org
17732923532887146 drwxrwx---+ 1 0 Jun 13 11:54 .registry.npmjs.org

getting it using ls -i

@zkochan:
check the files not the folders
folders cannot be hard links
go to one of the packages and check the package.json for instance

@marxus85:
ok

@zkochan:
but there is an easier solution
just edit the file and you'll see the changes in all 3 folders

@marxus85:
ok😄

@zkochan:
but if you edit it, it will be refetched during next installation

@marxus85:
well. ! it worked.
thanks. it wasnt that clear from the docs.
i mean i did read the "why does my nodemodules folder use disk space" section
but that simple method of just editing the file and see for myself:) well that satisfied me !😄


back to pnpm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment