29

I am new to Angular 6 ,In my project I got the below error

 ERROR in multi ./node_modules/bootstrap/dist/css/bootstrap.min.css ./styles.css
Module not found: Error: Can't resolve 'C:\Users\User\e-CommerceWebsite\styles.css' in 'C:\Users\User\e-CommerceWebsite'

and the browser shows

cannot Get

angular.json

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

styles.css

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

Referred this : bootstrap not connect to the angular 6?

Can anyone help me to fix this error .

2
  • only need to change the file that is loaded in angular.json according to the existing file the answer is here Commented Mar 18, 2019 at 6:19
  • stackoverflow.com/questions/50559810/… This might work. Commented Jun 28, 2020 at 7:26

33 Answers 33

1
2
0

The problem can be solved in this ways: try:

 "styles": [
              {
                "input": "./node_modules/bootstrap/dist/css/bootstrap.min.css"
              },
              {
                "input": "./node_modules/font-awesome/css/font-awesome.min.css"
              },
              "src/styles.css"
            ],
            "scripts": [
              "node_modules/jquery/dist/jquery.min.js",
              "node_modules/bootstrap/dist/js/bootstrap.min.js"
            ]
Sign up to request clarification or add additional context in comments.

Comments

0

I tried a step as follows:

Use:

../node_modules/bootstrap/dist/css/bootstrap.min.css

instead of

node_modules/bootstrap/dist/css/bootstrap.min.css

and save all and exit the editor, and run again,Its worked for me, most of the time if u face any error just save all and nd exit editor, the open and run again, hopefully it will work

Comments

0

See it happens when you enter wrong path or the file you've entered is not in that directory.

In your case "styles.css" path is wrong. It should be "src/styles.css"

Comments

1
2

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.