错误在./node_modules/css-loader?{"sourceMap":false,"importLoaders&#34 ;:1}!./node_modules/postcss-loader?{"ident&#34 ;:" postcss"} ./ node_mod

时间:2018-02-16 02:37:04

标签: angular webpack

ERROR in ./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader?{"ident":"postcss"}!./node_modules/bootstrap/dist/css/bootstrap.min.css
Module build failed: BrowserslistError: Unknown browser major
    at error (E:\MyWorkspace\Angular\angulartest\node_modules\browserslist\index.js:37:11)
    at Function.browserslist.checkName (E:\MyWorkspace\Angular\angulartest\node_modules\browserslist\index.js:320:18)
    at Function.select (E:\MyWorkspace\Angular\angulartest\node_modules\browserslist\index.js:438:37)
    at E:\MyWorkspace\Angular\angulartest\node_modules\browserslist\index.js:207:41
    at Array.forEach (native)
    at browserslist (E:\MyWorkspace\Angular\angulartest\node_modules\browserslist\index.js:196:13)
    at Browsers.parse (E:\MyWorkspace\Angular\angulartest\node_modules\autoprefixer\lib\browsers.js:44:14)
    at new Browsers (E:\MyWorkspace\Angular\angulartest\node_modules\autoprefixer\lib\browsers.js:39:28)
    at loadPrefixes (E:\MyWorkspace\Angular\angulartest\node_modules\autoprefixer\lib\autoprefixer.js:56:18)
    at plugin (E:\MyWorkspace\Angular\angulartest\node_modules\autoprefixer\lib\autoprefixer.js:62:18)
    at LazyResult.run (E:\MyWorkspace\Angular\angulartest\node_modules\postcss\lib\lazy-result.js:274:20)
    at LazyResult.asyncTick (E:\MyWorkspace\Angular\angulartest\node_modules\postcss\lib\lazy-result.js:189:32)
    at LazyResult.asyncTick (E:\MyWorkspace\Angular\angulartest\node_modules\postcss\lib\lazy-result.js:201:22)
    at processing.Promise.then._this2.processed (E:\MyWorkspace\Angular\angulartest\node_modules\postcss\lib\lazy-result.js:228:20)
    at LazyResult.async (E:\MyWorkspace\Angular\angulartest\node_modules\postcss\lib\lazy-result.js:225:27)
    at LazyResult.then (E:\MyWorkspace\Angular\angulartest\node_modules\postcss\lib\lazy-result.js:131:21)
 @ ./node_modules/bootstrap/dist/css/bootstrap.min.css 4:14-127
 @ multi ./node_modules/bootstrap/dist/css/bootstrap.min.css ./src/styles.css

webpack: Failed to compile.

在运行>时出现Angular问题服务 感谢您的帮助。

+ - bootstrap@4.0.0

1 个答案:

答案 0 :(得分:3)

问题解决了。

我按照以下步骤降级了bootstrap:

  1. 卸载bootstrap@4.0.0:

    npm uninstall bootstrap --save
    
  2. 然后安装bootstrap@3.3.7:

    npm install bootstrap@3.3.7 --save