0

I know this question already asked here, but I am unable to resolve my error.

I just started ionic project and using this link to use auth using angular.

Everything working file but when I used

@Injectable({ providedIn: 'root' })

I am getting error

Typescript Error Expected 0 arguments, but got 1.

I follow every step mentioned in above link like:

1: npm install npm@latest -g

2: npm install -g @angular/cli, npm install @angular/cli

3: ng update @angular/cli

but when I use 4th step ng update @angular/core I am getting this Package "@ionic-native/splash-screen" has an incompatible peer dependency to "rxjs" (requires "^5.5.11", would install "6.4.0").

when i run ng update rxjs i am getting this Package "@angular/http" has an incompatible peer dependency to "rxjs" (requires "^5.5.0", would install "6.4.0").

and when I update http using ng update @angular/http, i am again getting this Package "@ionic-native/core" has an incompatible peer dependency to "rxjs" (requires "^5.5.11", would install "6.4.0").

So I am unable to upgrade @angular/core.

PS: I am totally new to ionic / angular, and I dont know whether I have issue in core version or anything else.

Note: I tried ng update, ng update --all, also tried to clean uninstall and re-install but nothing worked so far.

Versions:

Ionic Framework: 3.9.3 Ionic App Scripts: 3.2.3 Angular Core: ^5.2.11 Angular Compiler CLI: 5.2.11 Node: 10.15.3 OS Platform: Windows 7 Navigator Platform: Win32 User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/73.0.3683.86 Safari/537.36

Angular CLI: 7.3.8

Node: 10.15.3

OS: win32 x64

Angular: 5.2.11

... animations, common, compiler, core, forms, http

... platform-browser, platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.13.8

@angular-devkit/build-optimizer 0.0.35

@angular-devkit/core 7.3.8

@angular-devkit/schematics 7.3.8

@angular/cli 7.3.8

@angular/compiler-cli 7.2.12

@schematics/angular 7.3.8

@schematics/update 0.13.8

rxjs 5.5.11

typescript 2.6.2

webpack 3.12.0

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
Vivek
  • 449
  • 18
  • 36
  • I've never used ionic. But you're using version 3.9.3, which depends on a version of ANgular that is older than the one you're trying to upgrade to. The current version of Ionic is 4.2.0. If you just started an ionic project, why did you start with an old version? – JB Nizet Apr 06 '19 at 07:19
  • Reproduce the issue in [stackblitz](https://stackblitz.com/). – Tilak Dewangan Apr 06 '19 at 07:46
  • Looks like you are providing in either constructor or function some argument which is not expected – Sergey Apr 06 '19 at 08:33

1 Answers1

1

I am not sure but I think it seems like a dead lock situation. Can you manually update below versions of angular and rxjs and do

npm i

and then try to update ionic:

    "@angular/animations": "7.1.4",
    "@angular/common": "7.1.4",
    "@angular/compiler": "7.1.4",
    "@angular/core": "7.1.4",
    "@angular/forms": "7.1.4",
    "@angular/http": "7.1.4",
    "@angular/material": "7.2.1",
    "@angular/platform-browser": "7.1.4",
    "@angular/platform-browser-dynamic": "7.1.4",
    "@angular/router": "7.1.4",     
    "classlist.js": "1.1.20150312",
    "core-js": "2.6.1",
    "omni-slider": "1.2.1",
    "pikaday": "1.8.0",
    "rxjs": "6.3.3",
    "web-animations-js": "2.3.1",
    "zone.js": "0.8.26"
Shashank Vivek
  • 16,888
  • 8
  • 62
  • 104
  • also, if you have any exp in ionic angular then plz check this qoes, https://stackoverflow.com/questions/55613214/core-js15724-error-rangeerror-maximum-call-stack-size-exceeded-angular-ionic – Vivek Apr 11 '19 at 13:14
  • @Vivek : sure, let me check – Shashank Vivek Apr 12 '19 at 03:30