Issue
Update 1
I created a new project for test purposes using command ng new project1
. Then added bootstrap package like this ng add @ng-bootstrap/ng-bootstrap
. Even then same problem is occurring. Why?
About
I am using Angular CLI 13.1.3. while trying to install ng bootstrap
I faced following error details.
Then I tried to update the angular/compiler dependency from 13.1.3 to 13.1.0 using the following commands.
ng uninstall angular/compiler
ng remove angular/compiler
but both of them are not available in command list
Would you like to suggest something?
Error messages
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: practise1@0.0.0
npm ERR! Found: @angular/compiler@13.1.3
npm ERR! node_modules/@angular/compiler
npm ERR! @angular/compiler@"~13.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/compiler@"13.3.1" from @angular/localize@13.3.1
npm ERR! node_modules/@angular/localize
npm ERR! peer @angular/localize@"^13.0.0" from @ng-bootstrap/ng-bootstrap@12.0.1
npm ERR! node_modules/@ng-bootstrap/ng-bootstrap
npm ERR! @ng-bootstrap/ng-bootstrap@"12.0.1" from the root project
Solution
Following commands should work for creating a new Angular project with ng-bootstrap
npm i -g @angular/cli
ng new project1
cd project1
ng add @ng-bootstrap/ng-bootstrap
This will ensure you have the latest Angular CLI version before creating the project.
When you need to upgrade Angular dependencies, you can run ng update
. This will tell you any further commands you need to run to upgrade your Angular dependencies.
At this point, your package.json file should be in a good state, and anyone else can install your project using npm i
.
Answered By - ian9912
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.