[Question] How to include dependents of a linked package to the original project?
I'm using `npx link` to add a symlink for a _Common_ project of mine and use it inside _Project-A_ and _Project-B_.
_Project-A_ and _Project-B_ have a `package.json` that look like this:
```
"dependencies": {
...,
"common.ui": "file:../path-to-common-project",
...
}
```
I can't remember the order of steps I did but for some reason, it worked as expected once but it's not working anymore.
What I mean by "it worked" is that:
- in _Project-A_, I did `npx link ../path-to-common-project` and the result was successful as shown below

- then I did `npm ls --link` to see the created links and this is what I found below. As you can see, the extraneous libraries that are used by the _Common_ project were also linked. It worked as expected when I ran _Project-A_. I could instantly see the changes made in the _Common_ project when I ran _Project-A_.

- I, then, tried to do the same steps in _Project-B_. So I executed `npx link ../path-to-common-project` successfully. Then I ran `npm ls --link` to see the created links but I only found that only the _Common_ project was linked without the extraneous libraries as shown below. Also, building _Project-B_ fails because of those missing libraries.

I first thought that _Project-B_ has some different configuration but then I removed all the created links for _Project-A_ by running `npm unlink --no-save common.ui` and tried to re-add them once again but this time it didn't work. I could only see the _Common_ project linked without its 3rd party libraries.
Do you know why could that be the case? Am I missing something? Is there something I should do before linking a project?
关闭于 2023-10-12 1 条评论