I have two local npm projects, A
and B
.
Let's say A
depends on react
and has it listed as a dependency in the package.json
file. I use npm link
to make A
available for B
.
B
depends on A
and react
. I use npm link A
to use the local version of A
. However, as I know that A
already depends on react
, I do not include react
in my package.json
file of B
.
When I call npm install
I would expect npm to include transitive dependencies in the node_modules
folder. However, I cannot find react
in it nor can I use it in B
's code as long as I don't include the transitive dependency in B
's own package.json
file.
When I include other modules like react
, I also get transitive dependencies like fbjs
or encoding
resolved into my node_modules
folder.
So, where is the mistake? / Why are the dependencies of A
not included in B
's node_modules
folder?