BrowserslistError: Browser desconocido mayor -- javascript campo con angular campo con bootstrap-4 camp Relacionados El problema

BrowserslistError: Unknown browser major


16
vote

problema

Español

Estoy tratando de usar Bootstrap 4 con mi instalación angular. He corrido NPM Install --Save Bootstrap @ Siguiente pero tengo un descanso en Tiempo de ejecución:

  ./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader/lib?{"ident":"postcss","plugins":[null,null,null],"sourceMap":false}!./node_modules/bootstrap/dist/css/bootstrap.min.css Module build failed: BrowserslistError: Unknown browser major     at error (C:xampphtdocs ick_master_angularweb ode_modulesrowserslistindex.js:37:11)     at Function.browserslist.checkName (C:xampphtdocs ick_master_angularweb ode_modulesrowserslistindex.js:320:18)     at Function.select (C:xampphtdocs ick_master_angularweb ode_modulesrowserslistindex.js:438:37)     at C:xampphtdocs ick_master_angularweb ode_modulesrowserslistindex.js:207:41     at Array.forEach (native)     at browserslist (C:xampphtdocs ick_master_angularweb ode_modulesrowserslistindex.js:196:13)     at Browsers.parse (C:xampphtdocs ick_master_angularweb ode_modulesautoprefixerlibrowsers.js:44:14)     at new Browsers (C:xampphtdocs ick_master_angularweb ode_modulesautoprefixerlibrowsers.js:39:28)     at loadPrefixes (C:xampphtdocs ick_master_angularweb ode_modulesautoprefixerlibautoprefixer.js:56:18)     at plugin (C:xampphtdocs ick_master_angularweb ode_modulesautoprefixerlibautoprefixer.js:62:18)     at LazyResult.run (C:xampphtdocs ick_master_angularweb ode_modulespostcss-loader ode_modulespostcssliblazy-result.js:270:20)     at LazyResult.asyncTick (C:xampphtdocs ick_master_angularweb ode_modulespostcss-loader ode_modulespostcssliblazy-result.js:185:32)     at LazyResult.asyncTick (C:xampphtdocs ick_master_angularweb ode_modulespostcss-loader ode_modulespostcssliblazy-result.js:197:22)     at processing.Promise.then._this2.processed (C:xampphtdocs ick_master_angularweb ode_modulespostcss-loader ode_modulespostcssliblazy-result.js:224:20)     at LazyResult.async (C:xampphtdocs ick_master_angularweb ode_modulespostcss-loader ode_modulespostcssliblazy-result.js:221:27)     at LazyResult.then (C:xampphtdocs ick_master_angularweb ode_modulespostcss-loader ode_modulespostcssliblazy-result.js:127:21)  @ ./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader/lib?{"ident":"postcss","sourceMap":false}!./src/styles.css 3:10-190  @ ./src/styles.css  @ multi ./src/styles.css   

¿Puede alguien ayudar por favor?

Original en ingles

I'm trying to use bootstrap 4 with my angular installation. i've run npm install --save bootstrap@next but i have a break at runtime :

./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader/lib?{"ident":"postcss","plugins":[null,null,null],"sourceMap":false}!./node_modules/bootstrap/dist/css/bootstrap.min.css Module build failed: BrowserslistError: Unknown browser major     at error (C:\xampp\htdocs\tick_master_angular\web\node_modules\browserslist\index.js:37:11)     at Function.browserslist.checkName (C:\xampp\htdocs\tick_master_angular\web\node_modules\browserslist\index.js:320:18)     at Function.select (C:\xampp\htdocs\tick_master_angular\web\node_modules\browserslist\index.js:438:37)     at C:\xampp\htdocs\tick_master_angular\web\node_modules\browserslist\index.js:207:41     at Array.forEach (native)     at browserslist (C:\xampp\htdocs\tick_master_angular\web\node_modules\browserslist\index.js:196:13)     at Browsers.parse (C:\xampp\htdocs\tick_master_angular\web\node_modules\autoprefixer\lib\browsers.js:44:14)     at new Browsers (C:\xampp\htdocs\tick_master_angular\web\node_modules\autoprefixer\lib\browsers.js:39:28)     at loadPrefixes (C:\xampp\htdocs\tick_master_angular\web\node_modules\autoprefixer\lib\autoprefixer.js:56:18)     at plugin (C:\xampp\htdocs\tick_master_angular\web\node_modules\autoprefixer\lib\autoprefixer.js:62:18)     at LazyResult.run (C:\xampp\htdocs\tick_master_angular\web\node_modules\postcss-loader\node_modules\postcss\lib\lazy-result.js:270:20)     at LazyResult.asyncTick (C:\xampp\htdocs\tick_master_angular\web\node_modules\postcss-loader\node_modules\postcss\lib\lazy-result.js:185:32)     at LazyResult.asyncTick (C:\xampp\htdocs\tick_master_angular\web\node_modules\postcss-loader\node_modules\postcss\lib\lazy-result.js:197:22)     at processing.Promise.then._this2.processed (C:\xampp\htdocs\tick_master_angular\web\node_modules\postcss-loader\node_modules\postcss\lib\lazy-result.js:224:20)     at LazyResult.async (C:\xampp\htdocs\tick_master_angular\web\node_modules\postcss-loader\node_modules\postcss\lib\lazy-result.js:221:27)     at LazyResult.then (C:\xampp\htdocs\tick_master_angular\web\node_modules\postcss-loader\node_modules\postcss\lib\lazy-result.js:127:21)  @ ./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader/lib?{"ident":"postcss","sourceMap":false}!./src/styles.css 3:10-190  @ ./src/styles.css  @ multi ./src/styles.css 

Can someone help please?

        
 
 

Lista de respuestas

14
 
vote

El problema podría ser que obtuviste la última versión con algún error. Noté que bootstrap@4.0.0-beta.3 está causando este problema, pero no bootstrap@4.0.0-beta.2. Compruebe si el tuyo es el mismo. Intente desinstalar eso y ejecutar algo con una versión específica.

npm install bootstrap@4.0.0-alpha.6

Esto resolvió mi problema.

 

The issue could be that you got the latest build with some bug. I noticed that bootstrap@4.0.0-beta.3 is causing this issue, but not bootstrap@4.0.0-beta.2. Check if yours is the same. Try uninstalling that and run something with a specific version.

npm install bootstrap@4.0.0-alpha.6

This resolved my problem.

 
 
 
 
12
 
vote

Bootstrap Nueva versión viene, que es v4.0.0-beta.2 y su paquete.json tiene ^ bootstrap4.0.0-alfa.6, por lo que la nueva versión de Bootstrap quiere la lista de la lista de los navegadores.

para ejecutar su aplicación Eliminar la última etiqueta de la versión (^) & amp; Ejecutar el comando de instalación de NPM

 

Bootstrap new version come which is v4.0.0-beta.2 and your package.json has ^bootstrap4.0.0-alpha.6 so new bootstrap version wants browsers list dependency.

To run your app remove lastest version tag (^) & run npm install command

 
 
7
 
vote

para Bootstrap 4.0.0 (versión) Tengo que actualizar el CLI a 1.6.5 â € "y funciona!

    "dependencies": {     "@angular/animations": "^5.0.0",     "@angular/common": "^5.0.0",     "@angular/compiler": "^5.0.0",     "@angular/core": "^5.0.0",     "@angular/forms": "^5.0.0",     "@angular/http": "^5.0.0",     "@angular/platform-browser": "^5.0.0",     "@angular/platform-browser-dynamic": "^5.0.0",     "@angular/router": "^5.0.0",     "@ng-bootstrap/ng-bootstrap": "1.0.0-beta.9",     "bootstrap": "4.0.0",     "core-js": "^2.4.1",     "font-awesome": "^4.7.0",     "jquery": "^3.2.1",     "popper.js": "^1.12.9",     "rxjs": "^5.5.2",     "zone.js": "^0.8.14"   },   "devDependencies": {     "@angular/cli": "^1.6.5",     "@angular/compiler-cli": "^5.0.0",     "@angular/language-service": "^5.0.0",     "@types/jasmine": "~2.5.53",     "@types/jasminewd2": "~2.0.2",     "@types/node": "~6.0.60",     "codelyzer": "^4.0.1",     "jasmine-core": "~2.6.2",     "jasmine-spec-reporter": "~4.1.0",     "karma": "~1.7.0",     "karma-chrome-launcher": "~2.1.1",     "karma-cli": "~1.0.1",     "karma-coverage-istanbul-reporter": "^1.2.1",     "karma-jasmine": "~1.1.0",     "karma-jasmine-html-reporter": "^0.2.2",     "protractor": "~5.1.2",     "ts-node": "~3.2.0",     "tslint": "~5.7.0",     "typescript": "~2.4.2"   }   
 

For Bootstrap 4.0.0 (release) I have to upgrade the CLI to 1.6.5 xe2x80x94 and it works!

  "dependencies": {     "@angular/animations": "^5.0.0",     "@angular/common": "^5.0.0",     "@angular/compiler": "^5.0.0",     "@angular/core": "^5.0.0",     "@angular/forms": "^5.0.0",     "@angular/http": "^5.0.0",     "@angular/platform-browser": "^5.0.0",     "@angular/platform-browser-dynamic": "^5.0.0",     "@angular/router": "^5.0.0",     "@ng-bootstrap/ng-bootstrap": "1.0.0-beta.9",     "bootstrap": "4.0.0",     "core-js": "^2.4.1",     "font-awesome": "^4.7.0",     "jquery": "^3.2.1",     "popper.js": "^1.12.9",     "rxjs": "^5.5.2",     "zone.js": "^0.8.14"   },   "devDependencies": {     "@angular/cli": "^1.6.5",     "@angular/compiler-cli": "^5.0.0",     "@angular/language-service": "^5.0.0",     "@types/jasmine": "~2.5.53",     "@types/jasminewd2": "~2.0.2",     "@types/node": "~6.0.60",     "codelyzer": "^4.0.1",     "jasmine-core": "~2.6.2",     "jasmine-spec-reporter": "~4.1.0",     "karma": "~1.7.0",     "karma-chrome-launcher": "~2.1.1",     "karma-cli": "~1.0.1",     "karma-coverage-istanbul-reporter": "^1.2.1",     "karma-jasmine": "~1.1.0",     "karma-jasmine-html-reporter": "^0.2.2",     "protractor": "~5.1.2",     "ts-node": "~3.2.0",     "tslint": "~5.7.0",     "typescript": "~2.4.2"   } 
 
 
5
 
vote

Me he actualizado a la CLI angular 1.7.x y comenzó a funcionar bien. Recomiendo esta solución. Me refiero a actualizar el CLI angular y debería funcionar para usted!

Otra solución que elimina las siguientes líneas de node_modules / bootstrap / package.json

  "browserslist": [ "last 1 major version", <----- delete this line ">= 1%", <----- delete this line "Chrome >= 45", "Firefox >= 38", "Edge >= 12", "Explorer >= 10", "iOS >= 9", "Safari >= 9", "Android >= 4.4", "Opera >= 30" ],   
 

I've upgraded to Angular CLI 1.7.x and it started working fine. I recommend this solution. I mean upgrading the Angular CLI and it should work for you!

Another workaround is deleting the below lines from node_modules/bootstrap/package.json

"browserslist": [ "last 1 major version", <----- delete this line ">= 1%", <----- delete this line "Chrome >= 45", "Firefox >= 38", "Edge >= 12", "Explorer >= 10", "iOS >= 9", "Safari >= 9", "Android >= 4.4", "Opera >= 30" ], 
 
 
 
 
2
 
vote

estaba teniendo el mismo problema cambió mi dependencia en el paquete.json de este

  "dependencies": {     "@angular/animations": "^5.0.0",     "@angular/common": "^5.0.0",     "@angular/compiler": "^5.0.0",     "@angular/core": "^5.0.0",     "@angular/forms": "^5.0.0",     "@angular/http": "^5.0.0",     "@angular/platform-browser": "^5.0.0",     "@angular/platform-browser-dynamic": "^5.0.0",     "@angular/router": "^5.0.0",     "@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.9",     "bootstrap": "^4.0.0-beta.3",     "core-js": "^2.4.1",     "font-awesome": "^4.7.0",     "zone.js": "^0.8.14"   }   

a (cambiando "bootstrap": "4.0.0-beta.2" a una versión estable)

  "dependencies": {     "@angular/animations": "^5.0.0",     "@angular/common": "^5.0.0",     "@angular/compiler": "^5.0.0",     "@angular/core": "^5.0.0",     "@angular/forms": "^5.0.0",     "@angular/http": "^5.0.0",     "@angular/platform-browser": "^5.0.0",     "@angular/platform-browser-dynamic": "^5.0.0",     "@angular/router": "^5.0.0",     "@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.9",     "bootstrap": "4.0.0-beta.2",     "core-js": "^2.4.1",     "font-awesome": "^4.7.0",     "zone.js": "^0.8.14"   },   

entonces, ejecute: NPM Install NG Servir

Resuelto Problema. !!

 

Was having same issue changed my dependency in package.json from this

"dependencies": {     "@angular/animations": "^5.0.0",     "@angular/common": "^5.0.0",     "@angular/compiler": "^5.0.0",     "@angular/core": "^5.0.0",     "@angular/forms": "^5.0.0",     "@angular/http": "^5.0.0",     "@angular/platform-browser": "^5.0.0",     "@angular/platform-browser-dynamic": "^5.0.0",     "@angular/router": "^5.0.0",     "@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.9",     "bootstrap": "^4.0.0-beta.3",     "core-js": "^2.4.1",     "font-awesome": "^4.7.0",     "zone.js": "^0.8.14"   } 

to (changing "bootstrap": "4.0.0-beta.2" to a stable version)

"dependencies": {     "@angular/animations": "^5.0.0",     "@angular/common": "^5.0.0",     "@angular/compiler": "^5.0.0",     "@angular/core": "^5.0.0",     "@angular/forms": "^5.0.0",     "@angular/http": "^5.0.0",     "@angular/platform-browser": "^5.0.0",     "@angular/platform-browser-dynamic": "^5.0.0",     "@angular/router": "^5.0.0",     "@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.9",     "bootstrap": "4.0.0-beta.2",     "core-js": "^2.4.1",     "font-awesome": "^4.7.0",     "zone.js": "^0.8.14"   }, 

then,run: npm install ng serve

problem solved.!!

 
 
0
 
vote

Bootstrap 4 ya no usa CSS. En esta versión se utiliza el SCSS. Así que en lugar de importar '~bootstrap/scss/bootstrap.css' , Debe importar '~bootstrap/scss/bootstrap.scss' .

 

Bootstrap 4 doesn't use CSS anymore. In this version the SCSS is used. So instead of importing '~bootstrap/scss/bootstrap.css', you should import '~bootstrap/scss/bootstrap.scss'.

 
 
0
 
vote

Tuve el mismo problema con Bootstrap 4.1.1. La solución es cambiar la versión de Boostrap a 4.0.0-beta.2 (sin la caret) en package.json luego ejecute

  npm install  ng serve   

y también agregue import "~bootstrap/dist/css.bootstrap.css" en su archivo "dependencies": { "@angular/animations": "^5.0.0", "@angular/common": "^5.0.0", "@angular/compiler": "^5.0.0", "@angular/core": "^5.0.0", "@angular/forms": "^5.0.0", "@angular/http": "^5.0.0", "@angular/platform-browser": "^5.0.0", "@angular/platform-browser-dynamic": "^5.0.0", "@angular/router": "^5.0.0", "@ng-bootstrap/ng-bootstrap": "1.0.0-beta.9", "bootstrap": "4.0.0", "core-js": "^2.4.1", "font-awesome": "^4.7.0", "jquery": "^3.2.1", "popper.js": "^1.12.9", "rxjs": "^5.5.2", "zone.js": "^0.8.14" }, "devDependencies": { "@angular/cli": "^1.6.5", "@angular/compiler-cli": "^5.0.0", "@angular/language-service": "^5.0.0", "@types/jasmine": "~2.5.53", "@types/jasminewd2": "~2.0.2", "@types/node": "~6.0.60", "codelyzer": "^4.0.1", "jasmine-core": "~2.6.2", "jasmine-spec-reporter": "~4.1.0", "karma": "~1.7.0", "karma-chrome-launcher": "~2.1.1", "karma-cli": "~1.0.1", "karma-coverage-istanbul-reporter": "^1.2.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "~5.1.2", "ts-node": "~3.2.0", "tslint": "~5.7.0", "typescript": "~2.4.2" } 0 .

 

I had the same problem with Bootstrap 4.1.1. Solution is to change Boostrap version to 4.0.0-beta.2 (without the caret) in package.json then run

npm install  ng serve 

And also add import "~bootstrap/dist/css.bootstrap.css" in your style.css file.

 
 
-1
 
vote

Funciona ahora sin solución alternativa con CLI angular: 1.6.5 . CLI angular ha estado dependiendo de una versión incompatible del autoprefixer ( https://github.com/ angular / angular-cli / problemas / 9020 )

Verifique la versión escribiendo ng --version . NO FOGET para actualizar su dependencia de DEV en Package.json:

    "dependencies": {     "@angular/animations": "^5.0.0",     "@angular/common": "^5.0.0",     "@angular/compiler": "^5.0.0",     "@angular/core": "^5.0.0",     "@angular/forms": "^5.0.0",     "@angular/http": "^5.0.0",     "@angular/platform-browser": "^5.0.0",     "@angular/platform-browser-dynamic": "^5.0.0",     "@angular/router": "^5.0.0",     "@ng-bootstrap/ng-bootstrap": "1.0.0-beta.9",     "bootstrap": "4.0.0",     "core-js": "^2.4.1",     "font-awesome": "^4.7.0",     "jquery": "^3.2.1",     "popper.js": "^1.12.9",     "rxjs": "^5.5.2",     "zone.js": "^0.8.14"   },   "devDependencies": {     "@angular/cli": "^1.6.5",     "@angular/compiler-cli": "^5.0.0",     "@angular/language-service": "^5.0.0",     "@types/jasmine": "~2.5.53",     "@types/jasminewd2": "~2.0.2",     "@types/node": "~6.0.60",     "codelyzer": "^4.0.1",     "jasmine-core": "~2.6.2",     "jasmine-spec-reporter": "~4.1.0",     "karma": "~1.7.0",     "karma-chrome-launcher": "~2.1.1",     "karma-cli": "~1.0.1",     "karma-coverage-istanbul-reporter": "^1.2.1",     "karma-jasmine": "~1.1.0",     "karma-jasmine-html-reporter": "^0.2.2",     "protractor": "~5.1.2",     "ts-node": "~3.2.0",     "tslint": "~5.7.0",     "typescript": "~2.4.2"   } 111  
 

It works now without workaround with Angular CLI: 1.6.5. Angular CLI has been depending on an incompatible version of autoprefixer (https://github.com/angular/angular-cli/issues/9020)

Verify version by typing ng --version. Do not foget to update your dev dependency in package.json:

"@angular/cli": "1.6.5", 
 
 
     
     
-1
 
vote

para aquellos que aún tienen problemas:

Retire manualmente la URL a BOOTSRAP CSS de angular-cli.json

    "dependencies": {     "@angular/animations": "^5.0.0",     "@angular/common": "^5.0.0",     "@angular/compiler": "^5.0.0",     "@angular/core": "^5.0.0",     "@angular/forms": "^5.0.0",     "@angular/http": "^5.0.0",     "@angular/platform-browser": "^5.0.0",     "@angular/platform-browser-dynamic": "^5.0.0",     "@angular/router": "^5.0.0",     "@ng-bootstrap/ng-bootstrap": "1.0.0-beta.9",     "bootstrap": "4.0.0",     "core-js": "^2.4.1",     "font-awesome": "^4.7.0",     "jquery": "^3.2.1",     "popper.js": "^1.12.9",     "rxjs": "^5.5.2",     "zone.js": "^0.8.14"   },   "devDependencies": {     "@angular/cli": "^1.6.5",     "@angular/compiler-cli": "^5.0.0",     "@angular/language-service": "^5.0.0",     "@types/jasmine": "~2.5.53",     "@types/jasminewd2": "~2.0.2",     "@types/node": "~6.0.60",     "codelyzer": "^4.0.1",     "jasmine-core": "~2.6.2",     "jasmine-spec-reporter": "~4.1.0",     "karma": "~1.7.0",     "karma-chrome-launcher": "~2.1.1",     "karma-cli": "~1.0.1",     "karma-coverage-istanbul-reporter": "^1.2.1",     "karma-jasmine": "~1.1.0",     "karma-jasmine-html-reporter": "^0.2.2",     "protractor": "~5.1.2",     "ts-node": "~3.2.0",     "tslint": "~5.7.0",     "typescript": "~2.4.2"   } 2  
 

For those still having problems:

Manually remove the url to bootsrap CSS from angular-cli.json

  "styles":   [     **"../node_modules/bootstrap/dist/css/bootstrap.min.css",**     "../node_modules/font-awesome/css/font-awesome.min.css",         "styles.css"   ] 
 
 
 
 

Relacionados problema

1  Bootstrap 4 - Diseño de mampostería combinado con el sistema de cuadrícula (dos, tres, cuatro y seis diseños de columna) [duplicado]  ( Bootstrap 4 masonry layout combined with the grid system two three four and ) 
Esta pregunta ya tiene respuestas aquí : Bootstrap 4 Diseño de mampostería Utilizando la cuadrícula ...

0  Bootstrap: la altura de la imagen no cambia si "Col img-fluid" combinada en una clase junto con la imagen  ( Bootstrap image height does not change if col img fluid combined in a class a ) 
La altura de la imagen no cambia: <!DOCTYPE html> <html> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta ...

0  Trabajar alrededor para cuando Jquery Ui no tiene en cuenta los márgenes cuando se anima  ( Work around for when jquery ui doesnt account for margins when animating ) 
-hello, mundo! - El título da un rumbo bastante decente de lo que estoy luchando. No puedo encontrar ninguna pregunta que tenga este problema exacto, y no e...

1  ¿Cómo hacer el botón en Bootstrap 4 tarjeta de la tarjeta?  ( How to make button on bootstrap 4 card border ) 
¿Hay alguna forma de usar CSS para hacer un botón para una tarjeta de bootstrap que estará en la frontera con la tarjeta? Como en la imagen de abajo: Est...

-1  La imagen no está cargada correctamente en el control deslizante de la imagen de página completa en HTML  ( Image is not load properly in full page image slider in html ) 
Quiero cargar un control deslizante en mi sitio web. Pero en image los controles deslizantes no se cargan correctamente. Puede ser que es un problema relaci...

0  Centro Alinee el contenido en pantallas pequeñas  ( Center align content in small screens ) 
Soy nuevo en Bootstrap 4. Tratando de crear un sistema de cuadrícula que haya dejado alineado contenido en pantallas más anchas y contenido centrado en pantal...

0  Angular 5 Obtener solicitud no respondida  ( Angular 5 get request nonresponsive ) 
He visto muchos problemas similares con respecto a este problema en este sitio, pero tienden a ser demasiado específicos (con Django, Python, Spring, etc.) o ...

0  ¿Cómo funcionan las tarjetas de bootstrap 4?  ( How do bootstrap 4 board cards ) 
Estoy usando bootstrap 4 beta. Necesito crear una tarjeta de tablero o en el tablero en Trello o Github. Aprecio las ideas que me pueden ayudar. Lo pensé en...

0  OPCIÓN ACTIVA DE BOOTSTRAP DATEPKETER  ( Bootstrap datepicker active option ) 
Estoy usando Bootstrap DatePicker y quiero cambiar la opción activa para ser la costumbre. Ahora, mi opción activa es la primera, llamada "Hoy" y quiero ser l...

-2  Eliminación de fronteras alrededor de la página web  ( Removing borders around webpage ) 
En esta plantilla por Colorlib: https://colorlib.com/demo?theme=pemodule Estoy tratando de eliminar las fronteras púrpuras alrededor del exterior del sitio w...




© 2022 respuesta.top Reservados todos los derechos. Centro de preguntas y respuestas reservados todos los derechos