I am struggling building my angular library "@myproject/auth" which has a peerDependency on "@myproject/utilities".
When adding "@myproject/utilities" to my "@myproject/auth" dependencies it works but at the end of building I get:
Distributing npm packages with 'dependencies' is not recommended. Please consider adding @myproject/utilities to 'peerDependencies' or remove it from 'dependencies'. ✖ Writing package manifest Dependency @myproject/utilities must be explicitly allowed using the "allowedNonPeerDependencies" option.
When I add the utilities to my peerDependencies they dont get installed and the build process crashes with an Error:
error TS2307: Cannot find module '@myproject/utilities' or its corresponding type declarations.
I am super confused about peerDependencies right now and how to solve this problem.
I use npm ci
and then ng build auth
for the build of my auth library.
How can i fix this? Should I just use the allowedNonPeerDependencies option?
CodePudding user response:
Simply adding the @myproject/utilities to the devDependencies and the peerDependencies solved my problem.