Closed aIacoella closed 3 years ago
Sorry to hear about your troubles, but unfortunately this doesn't seem related to TSDX. TSDX doesn't impact how you install dependencies or what your package.json
says. This seems like a general ask for help for debugging NPM installation.
Issues also are not a support forum for debugging help. Feel free to use StackOverflow or something, but even there the expectation is that you furnish an MVCE, which is lacking here. You provided a single fairly large package.json
(should be two) and some folders, not a reproducible example.
I can offer some suggestions below, but again, this is not a support forum for debugging help, especially not for issues unrelated to TSDX.
only now I've realized that only a subset of all of the dependencies my module is using gets installed when the module I've been developing is installed in another project.
I am actually not sure if this is how npm is supposed to work, maybe it is.
It should automatically install everything in your package's package.json#dependencies
when your package is installed, so that error does seem weird
"autoprefixer": "^9.8.6", [...] "rollup-plugin-postcss": "^3.1.8", "rollup-plugin-svg": "^2.0.0"
I don't know what your library looks like, but these are normally devDeps, not dependencies.
and the subset of node_modules the library is installing when it is installed as a dependency: /Project/node_modules/widget-components/
I think you meant /Project/node_modules/widget-components/node_modules
. Also would be better to use ls
(or, on Windows, dir
) to output what's there rather than using a screenshot.
So it looks like it's missing a bunch of dependencies, but it also has an additional dependency that isn't present in your package.json
-- react-overlays
.
I suspect you're installing the wrong version of your package, and hence you have an outdated node_modules
. That would also suggest some version of your package has an incorrect package.json
if the code references react-clock
but it's not installed.
Otherwise I would just recommend deleting node_modules
and re-installing everything.
I forgot to add that my component library is installed as a git repo in the "father" project. I don't know if this has an impact or not.
No, it shouldn't. That just changes how it's installed and how you reference a version. If you're using git
installation I would recommend pinning to a specific commit-ish or, preferably, tag, as branches can change but a commit doesn't (and tag shouldn't). Perhaps you pinned to a branch and so you're getting different versions as you update.
Current Behavior
Hi, I have been developing a component library for a couple of months and only now I've realized that only a subset of all of the dependencies my module is using gets installed when the module I've been developing is installed in another project.
I am actually not sure if this is how npm is supposed to work, maybe it is.
The thing is, after adding my latest dependency to my library (react-clock), when I try to build (Webpack) the "Father" project that has my library as a dependency, it throws the following error:
Here I'll post the dependencies I have in my library's package.json:
and the subset of node_modules the library is installing when it is installed as a dependency: /Project/node_modules/widget-components/![image](https://user-images.githubusercontent.com/24484955/94158994-5648bd80-fe83-11ea-8d27-afedf4c3c08f.png)
edit: I forgot to add that my component library is installed as a git repo in the "father" project. I don't know if this has an impact or not.
Suggested solution(s)
The way I made the "Father" project work (correctly build), was to install react-clock as a dependency of the main project. This is of course only a workaround, and I'm trying to make it work as it is supposed to work.
My environment