Skip to content

Instantly share code, notes, and snippets.

@zkochan
Last active November 2, 2021 05:40
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zkochan/106cfef49f8476b753a9cbbf9c65aff1 to your computer and use it in GitHub Desktop.
Save zkochan/106cfef49f8476b753a9cbbf9c65aff1 to your computer and use it in GitHub Desktop.
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:smile:

@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 !:smile:


back to pnpm

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