Cannot find modules from local package

Viewed 256

I've create an Angular library my-lib project follow this Angular.io tutorial, after build success, I've run npm pack at ./projects/my-lib path to compress my-lib following this tutorial to pack it to .tgz package.

In my-app project, I've copied my-lib-xxx.tgz (packed from my-lib library) to root directory then run npm install ./my-lib-xxx.tgz --save-dev. After that, my-app package.json file look like this:

devDependencies: {
    ...
    "my-lib":"file:my-lib-xxx.tgz",
    ...
}

But when I import my-lib to my app.module.ts, IDE keep telling me that it Cannot find module 'my-lib'. ts(2307).

Did I missing something?

p/s: I've generated my-lib library in the same workspace with my-app and it work. But I want to make those 2 separated from each other.

I'm using angular 8 with Visual Studio Code

0 Answers
Related