
Why doesn't NPM first check if the package is already installed locally? - blrboy
And then a symlink or something of the sort could be created - or perhaps even a copy of the module in question. Why isn&#x27;t this the way npm works?<p>If I initialize 10 different projects, and they all need React, I&#x27;d presumably do npm install react 10 distinct times. Which is fine, since each app is standalone - but why &quot;waste&quot; bandwidth by making separate requests for each one?
======
photonios
Not sure about NPM, but Yarn, even v1 without PNP caches all packages and
simply copies the package from the local cache into your `node_modules`.

It doesn't do symlinks (PNP mode does) because this doesn't always work well
and it definitely doesn't work well on Windows.

See:
[https://classic.yarnpkg.com/en/docs/cli/cache/](https://classic.yarnpkg.com/en/docs/cli/cache/)

------
MBCook
Yarn’s PNP mode does this.

