I'm using Angular 8. As per the business requirement, there is an isolated application that is separate from the main application but will be used in the main application.
For that I created a library
using the command
ng generate library my-library
The my-library/package.json has following dependencies
{
"name": "my-library",
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^8.2.14",
"@angular/core": "^8.2.14",
"ngx-device-detector": "^1.4.5",
"@fortawesome/fontawesome-svg-core": "^1.2.26",
"@fortawesome/free-brands-svg-icons": "^5.12.0",
"@fortawesome/free-regular-svg-icons": "^5.12.0",
"@fortawesome/free-solid-svg-icons": "^5.12.0",
"ngx-spinner": "^9.0.2"
}
}
The library is inside the application in the project
directory, thus the directory structure is
|- app
|- package
|- my-library
|- src/
|- package.json # Library dependencies
|- src # Main application
|- app
|- environments
|- angular.json
|- package.json # Application dependencies
I installed the dependencies from /app
directory
npm install
Then building the library using
ng build my-library
But this gives the error
...
Cannot find module 'ngx-device-detector'
...
How can I install the library dependencies?