Unable to add spartacus in angular application

64 views Asked by At

I am unable to add sparatcus in my angular application

Steps I did ::

  1. Created angular application [ng new xyz --style=scss --routing=false]
  2. added .npmrc file.
  3. ran :: ng add @spartacus/[email protected]

now I am getting below error while executing

npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: @spartacus/[email protected]
npm ERR! node_modules/@spartacus/core
npm ERR!   @spartacus/core@"~6.3.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @spartacus/core@"6.8.0" from @spartacus/[email protected]
npm ERR! node_modules/@spartacus/pdf-invoices
npm ERR!   @spartacus/pdf-invoices@"~6.8.0" from the root project

I am using following versions for installation :: Angular CLI: 15.2.10, Node: 16.13.0, Package Manager: npm 8.1.0, OS: darwin arm64

Package.json file ::

{
  "name": "xyz",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^15.2.4",
    "@angular/common": "^15.2.4",
    "@angular/compiler": "^15.2.4",
    "@angular/core": "^15.2.4",
    "@angular/forms": "^15.2.4",
    "@angular/platform-browser": "^15.2.4",
    "@angular/platform-browser-dynamic": "^15.2.4",
    "@angular/router": "^15.2.4",
    "@angular/service-worker": "^15.2.4",
    "@fontsource/open-sans": "^4.5.14",
    "@fortawesome/fontawesome-free": "5.8.1",
    "@ng-select/ng-select": "^10.0.3",
    "@ngrx/effects": "^15.3.0",
    "@ngrx/router-store": "^15.3.0",
    "@ngrx/store": "^15.3.0",
    "@spartacus/asm": "~6.3.0",
    "@spartacus/assets": "~6.3.0",
    "@spartacus/cart": "~6.3.0",
    "@spartacus/checkout": "~6.3.0",
    "@spartacus/core": "~6.3.0",
    "@spartacus/order": "~6.3.0",
    "@spartacus/pdf-invoices": "~6.8.0",
    "@spartacus/product": "~6.3.0",
    "@spartacus/smartedit": "~6.3.0",
    "@spartacus/storefinder": "~6.3.0",
    "@spartacus/storefront": "~6.3.0",
    "@spartacus/styles": "~6.3.0",
    "@spartacus/tracking": "~6.3.0",
    "@spartacus/user": "~6.3.0",
    "angular-oauth2-oidc": "^15.0.1",
    "bootstrap": "^4.6.2",
    "i18next": "^21.9.1",
    "i18next-http-backend": "^1.4.1",
    "i18next-resources-to-backend": "^1.1.2",
    "ngx-infinite-scroll": "^15.0.0",
    "rxjs": "^6.6.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.13.0"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^15.2.4",
    "@angular/cli": "^15.2.4",
    "@angular/compiler-cli": "^15.2.4",
    "@spartacus/schematics": "^6.8.0",
    "@types/jasmine": "~4.3.0",
    "jasmine-core": "~4.6.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.2.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.1.0",
    "typescript": "~4.9.4"
  }
}

Any help would be really helpful Thanks in advance

1

There are 1 answers

0
Kumar Rituraj On

It looks like NPM issue . Use force command to install all dependency & check once. npm i --force

Regards KR