Answer the question
In order to leave comments, you need to log in
What's wrong with the NPM library?
A very strange problem.
There is a library of components (Angular, TypeScript), uploaded and available on NPM. After the last update and the publication of the library on NPM (a very minor update, in fact, two lines inside the component that do not make any difference) stopped working.
I update (just on a local project, npm install ), run it, it displays in the console:
node_modules/<lib name>/dist/button/button.d.ts(2,47): error TS2307: Cannot find module '../core'.
Answer the question
In order to leave comments, you need to log in
In short, I solved the problem. Added the files field to package.json:
"files": [
"dist/"
]
Deep under the hood, Angular uses webpack, which is very fond of calculating dependencies and optimizing unused modules.
Most likely, he failed to install the dependency between button and core.
Try specifying the full path from the project root there instead of `..`
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question