@@ -157,33 +157,33 @@ In this case, we might expect a folder structure like this:
157
157
+-- node_modules
158
158
+-- blerg (1.2.5) <---[A]
159
159
+-- bar (1.2.3) <---[B]
160
- | + -- node_modules
161
- | | ` -- baz (2.0.2) <---[C]
162
- | | `-- node_modules
163
- | | `-- quux (3.2.0)
164
- | `-- asdf (2.3.4)
160
+ | ` -- node_modules
161
+ | + -- baz (2.0.2) <---[C]
162
+ | | `-- node_modules
163
+ | | `-- quux (3.2.0)
164
+ | `-- asdf (2.3.4)
165
165
`-- baz (1.2.3) <---[D]
166
166
`-- node_modules
167
167
`-- quux (3.2.0) <---[E]
168
168
169
- Since foo depends directly on
[email protected] and
[email protected] , those are
169
+ Since foo depends directly on
` [email protected] ` and
` [email protected] ` , those are
170
170
installed in foo's ` node_modules ` folder.
171
171
172
172
Even though the latest copy of blerg is 1.3.7, foo has a specific
173
173
dependency on version 1.2.5. So, that gets installed at [ A] . Since the
174
- parent installation of blerg
satisfie's bar's dependency on
[email protected] ,
174
+ parent installation of blerg
satisfies bar's dependency on
` [email protected] ` ,
175
175
it does not install another copy under [ B] .
176
176
177
177
Bar [ B] also has dependencies on baz and asdf, so those are installed in
178
178
bar's
` node_modules ` folder. Because it depends on
` [email protected] ` , it cannot
179
179
re-use the
` [email protected] ` installed in the parent
` node_modules ` folder
[ D
] ,
180
180
and must install its own copy [ C] .
181
181
182
- Underneath bar, the ` baz-> quux-> bar ` dependency creates a cycle.
183
- However, because ` bar ` is already in ` quux ` 's ancestry [ B] , it does not
182
+ Underneath bar, the ` baz -> quux -> bar ` dependency creates a cycle.
183
+ However, because bar is already in quux's ancestry [ B] , it does not
184
184
unpack another copy of bar into that folder.
185
185
186
- Underneath ` foo-> baz ` [ D] , quux's [ E] folder tree is empty, because its
186
+ Underneath ` foo -> baz ` [ D] , quux's [ E] folder tree is empty, because its
187
187
dependency on bar is satisfied by the parent folder copy installed at [ B] .
188
188
189
189
For a graphical breakdown of what is installed where, use ` npm ls ` .
0 commit comments