npm link is not working with angular-cli created projects

Add the following to your tsconfig.json of the host application you are loading the npm-linked lib into.

    "paths": {
      "@angular/*": ["node_modules/@angular/*"]
    }

Apparently the linked packages can't use peer dependancies normally. This will force the library to use your app's node_modules/@angular/* libs, which is what happens when you npm install the lib.


It's working now with a "preserveSymlinks": true in your angular.json.

just add it there : project > architect > build.


You wont be able. Let me quote

We don't support Library building with the CLI right now. We do support linking libraries built properly inside a CLI application.

https://github.com/angular/angular-cli/issues/9273


In Angular 7, "preserveSymlinks": true

It worked for me: project > architect > build > options