I’ve created a new project in Angular my Node version v20.13.1 and Angular version v18.0.1. I downloaded a free template from CodedThemes and added all the template files to my project, following their documentation. However, when I attempted to add Angular Material to it by running the script ng add @angular/material, an error occurred.
ℹ Using package manager: npm
✔ Found compatible package version: @angular/[email protected].
✔ Package information loaded.
The package @angular/[email protected] will be installed and executed.
Would you like to proceed? Yes
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @ng-bootstrap/[email protected]
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/common
npm ERR! peer @angular/common@”^17.0.0 || ^18.0.0″ from @angular/[email protected]
npm ERR! node_modules/@angular/cdk
npm ERR! peer @angular/cdk@”>=16.0.0″ from [email protected]
npm ERR! node_modules/ngx-scrollbar
npm ERR! ngx-scrollbar@”^13.0.3″ from the root project
npm ERR! @angular/cdk@”^17.3.6″ from the root project
npm ERR! 1 more (@angular/material)
npm ERR! peer @angular/common@”18.0.0″ from @angular/[email protected]
npm ERR! node_modules/@angular/forms
npm ERR! @angular/forms@”^18.0.0-next.3″ from the root project
npm ERR! peer @angular/forms@”^17.0.0 || ^18.0.0″ from @angular/[email protected]
npm ERR! node_modules/@angular/material
npm ERR! @angular/material@”17.3.10″ from the root project
npm ERR! 6 more (@angular/platform-browser, …)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@”^17.0.0″ from @ng-bootstrap/[email protected]
npm ERR! node_modules/@ng-bootstrap/ng-bootstrap
npm ERR! @ng-bootstrap/ng-bootstrap@”^16.0.0″ from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/[email protected]
npm ERR! node_modules/@angular/common
npm ERR! peer @angular/common@”^17.0.0″ from @ng-bootstrap/[email protected]
npm ERR! node_modules/@ng-bootstrap/ng-bootstrap
npm ERR! @ng-bootstrap/ng-bootstrap@”^16.0.0″ from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with –force or –legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
✖ Packages installation failed, see above.