17
u/Megajin_ Jan 28 '21
Nothing can shock me. Until the number of outdated modules hit me... Have fun fixing that in production.
10
u/StoneCypher Jan 28 '21
it kills me how completely unnecessary this is
npm disallows republishing a version number. therefore all we need is a single global cache by version number
we're doing this because nobody wants to figure out when it's time to remove an unused version number, says nine years ago, but six years ago they solved that for audit
now we're just doing it wrong so that an army of unimportant tools doesn't break (i'd rather they break personally)
other package managers don't have the problem of storing the same 1365245737 packages in the same 2437327 versions over and over and over and
4
Jan 28 '21
The JS community generally has an obsession with backwards compatibility which I think strays towards doing more harm than good.
3
u/Breserk Jan 28 '21
pnpm solves this and is fantastic. Each package exists once on your hard drive so it’s super fast
1
5
5
u/FirePing32 Jan 28 '21
You can use Yarn Plug'n'Play. It works without creating a node_module directory 😎!
7
u/cherryblossom001 Jan 28 '21
Or you could use pnpm, which hard links the packages in
node_modulesto the global store. This is more backwards-compatible than Plug'n'Play, which TypeScript doesn't support natively.1
4
2
2
2
1
u/LegitPurpleFerret Jan 29 '21
i dont like it but it also has a lot of advantages;
otherwise it is a constant reminder to check our own deps; do you really need them?
0
0
u/pisconz Jan 28 '21
i feel that pain when i have to copy paste it somewhere
5
u/jwktje Jan 28 '21
Why not just nuke node_modules and reinstall?
1
u/pisconz Jan 28 '21
i was talking specifically copying a release folder to its final location, sometimes in another pc or network location, cant really do the reinstall bit afterwards since not all installs have interwebs.
But i didn't knew we could do a nuke command, that was helpfull to run on dev pc environment to free up some space, TY.
59
u/NoMoney12 Jan 28 '21
Use pnpm