1

I have a local angular library created using ng generate library utils.

I then add its dependency to my angular project package.json, making sure to link to the inner lib folder under utils/dist/utils, and everything is working as expected:

"utils": "file:../utils/dist/utils"

When I look at the content of node_modules/utils in my angular module I see the content of utils/dist/utils.

I'm now refactoring the project to use NPM Workspaces so I can remove the dependency and NPM will install it automatically since it is a workspace.

The issue is that NPM is taking the entire root folder of the library and not the inner dist/utils folder and everything breaks.

When I look at the content of node_modules/utils in the root folder I now see the content of utils.

I get an error in all my imports stating:

TS2307: Cannot find module 'utils' or its corresponding type declarations.

Is there a proper solution to this issue?

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.