Hi i hav latest angular cli in my machine. i have tried to install bootstrap on angular project. These are the steps i have followed .
Then open the project in vs codein the angular.json file i copy below code.
"styles": [ "styles.css", "../node_modules/bootstrap/dist/css/bootstrap.css" ], "scripts": [ "../node_modules/jquery/dist/jquery.min.js", "../node_modules/bootstrap/dist/js/bootstrap.js" ]
after that i run the project ng serve i got this error msg.
Angular Live Development Server is listening on localhost: 4200, open your browser on http://localhost:4200/ ** 91% additional asset processing scripts-webpack-plugin× 「wdm」: Error: ENOENT: no such file or directory, open 'D:\Angular\node_modules\jquery\dist\jquery.min.js'
CLI projects in angular 6 onwards will be using  angular.json instead of .angular-cli.json for build and project configuration.
Each CLI workspace has projects, each project has targets, and each target can have configurations.Docs
. {
  "projects": {
    "my-project-name": {
      "projectType": "application",
      "architect": {
        "build": {
          "configurations": {
            "production": {},
            "demo": {},
            "staging": {},
          }
        },
        "serve": {},
        "extract-i18n": {},
        "test": {},
      }
    },
    "my-project-name-e2e": {}
  },
}
In your angular.json  add the file paths to the styles and scripts array in under build target with ./ instead of ../
Boostrap 4 does not support Glyphicons anymore, you can use Font Awesome instead:
Execute npm install --save font-awesome and addd file path to the styles array
 "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist/ng6",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.app.json",
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ],
            "styles": [
              "src/styles.css","./node_modules/bootstrap/dist/css/bootstrap.min.css"
               "./node_modules/font-awesome/css/font-awesome.css"
            ],
            "scripts": ["./node_modules/jquery/dist/jquery.min.js",
                       "./node_modules/bootstrap/dist/js/bootstrap.min.js"]
          },
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With