1

I've added bootstrap to an Angular app created with Angular-CLI (ng new), after adding bootstrap to the project and referencing it from my .angular-cli.json file - ng serve wouldn't run.

ERROR LOG

ERROR in multi ./src/styles.css C:/server/node_modules/bootstrap/dist/css/bootstrap.css
Module not found: Error: Can't resolve 'C:\server\node_modules\bootstrap\dist\css\bootstrap.css' in 'C:\dev\mean\ems-mean\client\node_mod
ules\@angular\cli\models\webpack-configs'
resolve 'C:\server\node_modules\bootstrap\dist\css\bootstrap.css' in 'C:\dev\mean\ems-mean\client\node_modules\@angular\cli\models\webpac
k-configs'
  using description file: C:\dev\mean\ems-mean\client\node_modules\@angular\cli\package.json (relative path: ./models/webpack-configs)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: C:\dev\mean\ems-mean\client\node_modules\@angular\cli\package.json (relative path: ./models/webpack-confi
gs)
    No description file found
    no extension`enter code here`
      Field 'browser' doesn't contain a valid alias configuration
      C:\server\node_modules\bootstrap\dist\css\bootstrap.css doesn't exist
    .ts
      Field 'browser' doesn't contain a valid alias configuration
      C:\server\node_modules\bootstrap\dist\css\bootstrap.css.ts doesn't exist
    .js
      Field 'browser' doesn't contain a valid alias configuration
      C:\server\node_modules\bootstrap\dist\css\bootstrap.css.js doesn't exist
    as directory
          C:\server\node_modules\bootstrap\dist\css\bootstrap.css doesn't exist
    [C:\server\node_modules\bootstrap\dist\css\bootstrap.css\package.json]
    [C:\server\node_modules\bootstrap\dist\css\bootstrap.css]
    [C:\server\node_modules\bootstrap\dist\css\bootstrap.css.ts]
    [C:\server\node_modules\bootstrap\dist\css\bootstrap.css.js]
    [C:\server\node_modules\bootstrap\dist\css\bootstrap.css]
     @ multi ./src/styles.css C:/server/node_modules/bootstrap/dist/css/bootstrap.css
1
  • @M98 Thanks for your feedback. That seemed to do the trick Commented Oct 16, 2017 at 9:11

1 Answer 1

1

The problem is that you can't provide the absolute addresses to the module, try this:

  "../node_modules/bootstrap/dist/css/bootstrap.css"
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.