Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jasmine-core avoids installing angular-devkit/build-angular

Tags:

npm

angular

I run ng serve and there is the error about angular-devkit. So I installed it, but I got this error :

npm install @angular-devkit/build-angular            
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/jasmine-core
npm ERR!   dev jasmine-core@"~3.4.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer jasmine-core@">=3.5" from [email protected]
npm ERR! node_modules/karma-jasmine-html-reporter
npm ERR!   dev karma-jasmine-html-reporter@"^1.5.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

Here is package.json :

{
  "name": "edl-tools",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@amcharts/amcharts4": "^4.7.18",
    "@angular/animations": "^8.2.6",
    "@angular/common": "^8.2.14",
    "@angular/compiler": "^8.2.14",
    "@angular/core": "^8.2.14",
    "@angular/forms": "^8.2.14",
    "@angular/http": "7.2.15",
    "@angular/platform-browser": "^8.2.14",
    "@angular/platform-browser-dynamic": "^8.2.14",
    "@angular/router": "^8.2.14",
    "@ng-bootstrap/ng-bootstrap": "^5.1.4",
    "@ng-select/ng-select": "^3.7.1",
    "@progress/kendo-angular-pdf-export": "^1.2.0",
    "@progress/kendo-drawing": "^1.6.0",
    "@progress/kendo-theme-default": "^4.11.1",
    "@swimlane/ngx-datatable": "^14.0.0",
    "@types/bootstrap": "^4.3.1",
    "@types/datatables.net": "^1.10.18",
    "angular-6-datatable": "^0.8.0",
    "angular-datatables": "^6.0.0",
    "angular-google-charts": "^0.1.6",
    "angular-signature": "^1.0.3",
    "angular-signature-pad": "0.0.14",
    "angular2-signature-pad": "^1.0.2",
    "angular2-signaturepad": "^2.11.0",
    "bootstrap": "^4.4.1",
    "bootstrap-datepicker": "1.9.0",
    "bootstrap4-fullscreen-modal": "^1.0.5",
    "canvasjs": "^1.8.3",
    "chart.js": "^2.9.3",
    "chartjs-plugin-annotation": "latest",
    "chartjs-plugin-datalabels": "latest",
    "core-js": "^2.5.0",
    "datatables.net": "^1.10.20",
    "datatables.net-dt": "^1.10.20",
    "file-saver": "2.0.2",
    "font-awesome": "^4.7.0",
    "html2canvas": "^1.0.0-rc.5",
    "jquery": "^3.4.1",
    "jquery-toast-plugin": "^1.3.2",
    "jspdf": "^1.5.3",
    "ng-multiselect-dropdown": "^0.2.10",
    "ng-pick-datetime": "^5.2.6",
    "ng2-charts": "^1.6.0",
    "ng2-table": "^1.3.2",
    "ngx-bootstrap": "^5.3.2",
    "ngx-filter-pipe": "^2.1.2",
    "ngx-spinner": "^6.1.2",
    "ngx-toastr": "^10.2.0",
    "popper.js": "^1.14.3",
    "rxjs": "~6.4.0",
    "rxjs-compat": "^6.5.4",
    "tableexport": "^5.0.2",
    "tslib": "^1.10.0",
    "xlsx": "^0.14.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.803.23",
    "@angular/cli": "^8.3.29",
    "@angular/compiler-cli": "^8.2.14",
    "@angular/language-service": "^8.2.14",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "^2.0.8",
    "@types/jquery": "^3.3.31",
    "@types/node": "~8.9.4",
    "codelyzer": "^5.2.1",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.5.1",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.15.0",
    "typescript": "~3.5.3"
  }
}

So what should I do ?

like image 755
pheromix Avatar asked Dec 06 '22 08:12

pheromix


2 Answers

This one worked for me: I go to the "devDependencies" object

and I change [email protected] to [email protected]

like image 107
EUGENE NTAMACK Avatar answered Apr 04 '23 14:04

EUGENE NTAMACK


It seems [email protected] requires jasmine-core@">=3.5" but you have [email protected].

In package.json, change jasmine-core to 3.5.0 or greater and run an npm install again. Maybe you should also try deleting node_modules and doing a fresh install.

like image 20
AliF50 Avatar answered Apr 04 '23 16:04

AliF50