Javascript 在npm中安装后出现角度引导错误
我已经在NPMCLI中安装了jquery、popper.js和bootstrap。安装后,我在angularcli.json中为引导添加了样式引用。当我运行项目时,会显示以下错误。请帮忙Javascript 在npm中安装后出现角度引导错误,javascript,angular,npm,Javascript,Angular,Npm,我已经在NPMCLI中安装了jquery、popper.js和bootstrap。安装后,我在angularcli.json中为引导添加了样式引用。当我运行项目时,会显示以下错误。请帮忙 ERROR in ./~/css-loader?{"sourceMap":false,"importLoaders":1}!./~/postcss-loader?{"ident":"postcss"}!./~/bootstrap/dist/css/bootstrap.min.css Module build f
ERROR in ./~/css-loader?{"sourceMap":false,"importLoaders":1}!./~/postcss-loader?{"ident":"postcss"}!./~/bootstrap/dist/css/bootstrap.min.css
Module build failed: BrowserslistError: Unknown browser major
at error (C:\Users\hasan\angulartest\boottest\node_modules\browserslist\index.js:37:11)
at Function.browserslist.checkName (C:\Users\hasan\angulartest\boottest\node_modules\browserslist\index.js:320:18)
at Function.select (C:\Users\hasan\angulartest\boottest\node_modules\browserslist\index.js:438:37)
at C:\Users\hasan\angulartest\boottest\node_modules\browserslist\index.js:207:41
at Array.forEach (native)
at browserslist (C:\Users\hasan\angulartest\boottest\node_modules\browserslist\index.js:196:13)
at Browsers.parse (C:\Users\hasan\angulartest\boottest\node_modules\autoprefixer\lib\browsers.js:44:14)
at new Browsers (C:\Users\hasan\angulartest\boottest\node_modules\autoprefixer\lib\browsers.js:39:28)
at loadPrefixes (C:\Users\hasan\angulartest\boottest\node_modules\autoprefixer\lib\autoprefixer.js:56:18)
at plugin (C:\Users\hasan\angulartest\boottest\node_modules\autoprefixer\lib\autoprefixer.js:62:18)
at LazyResult.run (C:\Users\hasan\angulartest\boottest\node_modules\postcss\lib\lazy-result.js:274:20)
at LazyResult.asyncTick (C:\Users\hasan\angulartest\boottest\node_modules\postcss\lib\lazy-result.js:189:32)
at LazyResult.asyncTick (C:\Users\hasan\angulartest\boottest\node_modules\postcss\lib\lazy-result.js:201:22)
at processing.Promise.then._this2.processed (C:\Users\hasan\angulartest\boottest\node_modules\postcss\lib\lazy-result.js:228:20)
at LazyResult.async (C:\Users\hasan\angulartest\boottest\node_modules\postcss\lib\lazy-result.js:225:27)
at LazyResult.then (C:\Users\hasan\angulartest\boottest\node_modules\postcss\lib\lazy-result.js:131:21)
@ ./~/bootstrap/dist/css/bootstrap.min.css 4:14-127
@ multi ./~/bootstrap/dist/css/bootstrap.min.css ./src/styles.css
这看起来像是某种相关的问题。
请看这个:
- 从“引导”:“^4.0.0-beta.2”到“引导”:“4.0.0-beta.2”,取出“^”
- 然后安装npm
- 然后ng发球
来源:引导版本4似乎有bug。我在packages.json中将引导版本从4.0.0更改为3.0.0,并运行命令npm install。在那之后一切都很好