55 lines
1.8 KiB
Groff
55 lines
1.8 KiB
Groff
.P
|
|
[E]
|
|
```
|
|
.P
|
|
Since foo depends directly on \fBbar@1\.2\.3\fP and \fBbaz@1\.2\.3\fP, those are
|
|
installed in foo's \fBnode_modules\fP folder\.
|
|
.P
|
|
Even though the latest copy of blerg is 1\.3\.7, foo has a specific
|
|
dependency on version 1\.2\.5\. So, that gets installed at [A]\. Since the
|
|
parent installation of blerg satisfies bar's dependency on \fBblerg@1\.x\fP,
|
|
it does not install another copy under [B]\.
|
|
.P
|
|
Bar [B] also has dependencies on baz and asdf, so those are installed in
|
|
bar's \fBnode_modules\fP folder\. Because it depends on \fBbaz@2\.x\fP, it cannot
|
|
re\-use the \fBbaz@1\.2\.3\fP installed in the parent \fBnode_modules\fP folder [D],
|
|
and must install its own copy [C]\.
|
|
.P
|
|
Underneath bar, the \fBbaz \-> quux \-> bar\fP dependency creates a cycle\.
|
|
However, because bar is already in quux's ancestry [B], it does not
|
|
unpack another copy of bar into that folder\.
|
|
.P
|
|
Underneath \fBfoo \-> baz\fP [D], quux's [E] folder tree is empty, because its
|
|
dependency on bar is satisfied by the parent folder copy installed at [B]\.
|
|
.P
|
|
For a graphical breakdown of what is installed where, use \fBnpm ls\fP\|\.
|
|
.SS Publishing
|
|
.P
|
|
Upon publishing, npm will look in the \fBnode_modules\fP folder\. If any of
|
|
the items there are not in the \fBbundledDependencies\fP array, then they will
|
|
not be included in the package tarball\.
|
|
.P
|
|
This allows a package maintainer to install all of their dependencies
|
|
(and dev dependencies) locally, but only re\-publish those items that
|
|
cannot be found elsewhere\. See npm help \fBpackage\.json\fP for more information\.
|
|
.SS See also
|
|
.RS 0
|
|
.IP \(bu 2
|
|
npm help package\.json
|
|
.IP \(bu 2
|
|
npm help install
|
|
.IP \(bu 2
|
|
npm help pack
|
|
.IP \(bu 2
|
|
npm help cache
|
|
.IP \(bu 2
|
|
npm help config
|
|
.IP \(bu 2
|
|
npm help npmrc
|
|
.IP \(bu 2
|
|
npm help config
|
|
.IP \(bu 2
|
|
npm help publish
|
|
|
|
.RE
|