简体   繁体   中英

getting error while installing node package

Getting the following error while installing npm i

npm ERR! While resolving: angular-image-editor@0.0.1
npm ERR! Found: @angular/common@9.0.7
npm ERR! node_modules/@angular/common
npm ERR!   @angular/common@"~9.0.6" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^6.0.0-rc.0 || ^6.0.0" from angular-cropperjs@1.0.2
npm ERR! node_modules/angular-cropperjs
npm ERR!   angular-cropperjs@"^1.0.1" from the root project

I tried npm cache clean --force

but still I am getting the same error.

Here is my package.json :

{
  "name": "image-editor",
  "version": "0.0.1",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"    
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~9.0.6",
    "@angular/common": "~9.0.6",
    "@angular/compiler": "~9.0.6",
    "@angular/core": "~9.0.6",
    "@angular/forms": "~9.0.6",
    "@angular/platform-browser": "~9.0.6",
    "@angular/platform-browser-dynamic": "~9.0.6",
    "@angular/router": "~9.0.6",
    "angular-cropperjs": "^1.0.1",
    "angular-font-awesome": "^3.1.2",
    "bootstrap": "^4.1.3",
    "core-js": "^2.5.4",
    "cropperjs": "^1.4.3",
    "font-awesome": "^4.7.0",
    "merge-images": "^2.0.0",
    "rxjs": "~6.5.4",
    "tslib": "^1.10.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.900.6",
    "@angular/cli": "~9.0.6",
    "@angular/compiler-cli": "~9.0.6",
    "@angular/language-service": "~9.0.6",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.11.1",
    "codelyzer": "^5.1.2",
    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.3.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~2.1.0",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.2",
    "protractor": "~5.4.3",
    "ts-node": "~8.3.0",
    "tslint": "~5.18.0",
    "typescript": "~3.7.5"
  }
}

From what I could gather, the issue is due to the dependency angular-cropperjs .
This package requires @angular/core version 6.xx
See https://github.com/matheusdavidson/angular-cropperjs/blob/master/package.json
But your angular project's version is 9.xx

Either use a different dependency or downgrade your angular projects dependency.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM