Asad Khan
Asad Khan

Reputation: 289

Dependencies issue with Ngb bootstrap in Angular

I m new to Angular and I'm trying to create a image slider carousel in angular using ng bootstrap's component but after I have created an angular project I have installed "ng bootstrap" (in project) using npm install --save @ng-bootstrap/ng-bootstrap and have imported it in app.module.ts using import {NgbModule} from '@ng-bootstrap/ng-bootstrap';.

I have also installed ng add @angular/localize in the project but i m not sure what is wrong it is showing me the error below:

ERROR in The target entry-point "@ng-bootstrap/ng-bootstrap" has missing dependencies:
 - tslib
 - @angular/core
 - @angular/common
 - @angular/forms
 - rxjs
 - rxjs/operators

I'm following https://ng-bootstrap.github.io/#/getting-started. What should I try next?

Upvotes: 1

Views: 2619

Answers (2)

Mohammad Gayashuddin
Mohammad Gayashuddin

Reputation: 21

Make sure you are in root folder of your project then run this command

ng add @ng-bootstrap/ng-bootstrap 

or

npm i --save @ng-bootstrap/ng-bootstrap

Upvotes: 0

charbel
charbel

Reputation: 491

I would suggest installing jQuery and Popper.js in addition to Bootstrap:

npm install bootstrap --save
npm install jquery --save
npm install popper.js --save

in your project folder go to src/styles.cs and add the following line of code

@import "~bootstrap/dist/css/bootstrap.min.css";

then go to src/angular.json and add the following lines to "scripts":

 "scripts": [
 "./node_modules/jquery/dist/jquery.min.js",
 "./node_modules/popper.js/dist/umd/popper.min.js", 
 "./node_modules/bootstrap/dist/js/bootstrap.min.js"
]

Hope this help.

Upvotes: 1

Related Questions