hat is treated as the effective
&quot;current directory&quot; for the purpose of running npm commands.  (This
behavior is inspired by and similar to git&#39;s .git-folder seeking
logic when running git commands in a working dir.)</p>
<p>If no package root is found, then the current folder is used.</p>
<p>When you run <code>npm install foo@1.2.3</code>, then the package is loaded into
the cache, and then unpacked into <code>./node_modules/foo</code>.  Then, any of
foo&#39;s dependencies are similarly unpacke