You are right, this is why tool such as [pnpm](https://pnpm.io/) emerged and also Yarn cache stores downloaded packages to speed up future installations.
Yarn