Although I have already looked for a solution to this problemhere, I am still struggling to resolve the error on my own.
I recently started an Ionic project and followed this link to implement authentication using Angular.
Everything seemed to be working fine until I used the following code:
@Injectable({
providedIn: 'root'
})
This resulted in the error:
Typescript Error
Expected 0 arguments, but got 1.
I meticulously followed each step mentioned in the provided link, such as:
1: npm install npm@latest -g
2:
npm install -g @angular/cli, npm install @angular/cli
3: ng update @angular/cli
However, upon trying the 4th step ng update @angular/core
, I encountered this
Package "@ionic-native/splash-screen" has an incompatible peer dependency to "rxjs" (requires "^5.5.11", would install "6.4.0").
Subsequently, when I executed ng update rxjs
, I received this
Package "@angular/http" has an incompatible peer dependency to "rxjs" (requires "^5.5.0", would install "6.4.0").
Moreover, updating http
using ng update @angular/http
led to another error message:
Package "@ionic-native/core" has an incompatible peer dependency to "rxjs" (requires "^5.5.11", would install "6.4.0").
Consequently, I am at a standstill with upgrading @angular/core
.
Additional note: As a newcomer to Ionic/Angular, I am unsure if the problem lies within the core version
or elsewhere.
Note: I have attempted ng update
, ng update --all
, as well as clean uninstallation and reinstallation, to no avail.
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