0

I am new in angular using 12.1.4 version. I am unable to add or install bootstrap dependency in angular. When I run below command in cmd prompt.

ng add @ng-bootstrap/ng-bootstrap

Then it throw an error as shown in below image:

Angular Error

1

1 Answer 1

1

Install bootstrap in your angular 12 app like below. This is only for css importing.

npm install bootstrap --save

Now you need to import bootstrap css directly in style.css file like this:

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

However, if you are required to install bootstrap with jquery and popper js then run the following commands like below:

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

After successfully run the above commands import it in angular.json file like this:

 "styles": [
    "node_modules/bootstrap/dist/css/bootstrap.min.css",
    "src/styles.css"
  ],
  "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"
  ]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.