summaryrefslogtreecommitdiff
path: root/deps/npm/man/man5/folders.5
blob: 66542121955ce2eba3724f45b521048c2469dcf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
.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 \fBpackage\.json\fP \fI/docs/configuring\-npm/package\.json\fR for more information\.
.SS See also
.RS 0
.IP \(bu 2
npm help package\-json
.IP \(bu 2
npm help npm\-install
.IP \(bu 2
npm help npm\-pack
.IP \(bu 2
npm help npm\-cache
.IP \(bu 2
npm help npm\-config
.IP \(bu 2
npm help npmrc
.IP \(bu 2
npm help config
.IP \(bu 2
npm help npm\-publish

.RE