Angular cannot access bootstrap from node_modules when I provide path in angular.json file

Discussão em 'Angular' iniciado por Lambda, Março 26, 2025.

  1. Lambda

    Lambda Guest

    I am trying to install bootstrap in my Angular project.

    1. I used npm install --save bootstrap to install bootstrap in my project
    2. After that I installed jquery
    3. Provided path for bootstrap

    Below is the angular.json file:

    "styles": [
    "../node_modules/boostrap/dist/css/bootstrap.css",
    "src/styles.css"
    ],
    "scripts": [
    "../node_modules/jquery/dist/jquery.min.js",
    "../node_modules/bootstrap/dist/js/bootstrap.min.js"
    ]


    When I pass the above bootstrap path in style.css it works but I want to make it work by passing the path to angular.json.

    style.css file@import "../node_modules/bootstrap/dist/css/bootstrap.css"

    All the paths that I tried are mentioned below:

    "./node_modules/boostrap/dist/css/bootstrap.css"

    "node_modules/boostrap/dist/css/bootstrap.css"

    "../node_modules/boostrap/dist/css/bootstrap.css"

    Continue reading...

Compartilhe esta Página