#npm install local library

2 messages · Page 1 of 1 (latest)

stable haven
#

Hello, I have made a library and in the same project I have an app that use that library, and it works fine.

I have a completely different project where i want to use my library. I tried using npm i "path to library dist folder/my-library". and I can see it in node_modules,.
When I import { myModule } from 'my-library' I get this error: Module '"my-library"' has no exported member 'myModule'.

vague crescent
#

build your library with ng build --configuration production then pack your library with npm pack (in the dist folder) --> a .tgz will be generated

install your libary with npm i PATH_TO_YOUR_TGZ