Angular 角度可注入错误:应为0个参数,但得到1个
我知道这个问题已经问过了,但我无法解决我的错误 我刚刚启动了ionic项目,并使用它使用angular来使用auth 除了我使用Angular 角度可注入错误:应为0个参数,但得到1个,angular,typescript,ionic-framework,Angular,Typescript,Ionic Framework,我知道这个问题已经问过了,但我无法解决我的错误 我刚刚启动了ionic项目,并使用它使用angular来使用auth 除了我使用 @可注入({ providedIn:'根' }) 我犯了一个错误 Typescript错误 应为0个参数,但得到1个。 我遵循上述链接中提到的每个步骤,如: 1:npm安装npm@latest-g 2:npm安装-g@angular/cli,npm安装@angular/cli 3:ng update@angular/cli 但是当我使用第四步ng update@ang
@可注入({
providedIn:'根'
})
我犯了一个错误
Typescript错误
应为0个参数,但得到1个。
我遵循上述链接中提到的每个步骤,如:
1:npm安装npm@latest-g
2:npm安装-g@angular/cli,npm安装@angular/cli
3:ng update@angular/cli
但是当我使用第四步ng update@angular/core
时,我得到了这个包“@ionic native/splash screen”与“rxjs”具有不兼容的对等依赖关系(需要“^5.5.11”,将安装“6.4.0”)。
当我运行ng update rxjs
时,我得到一个包“@angular/http”与“rxjs”具有不兼容的对等依赖关系(需要“^5.5.0”,将安装“6.4.0”)。
当我使用ng update@angular/http
更新http
时,我再次得到这个包“@ionic native/core”与“rxjs”具有不兼容的对等依赖关系(需要“^5.5.11”,将安装“6.4.0”)。
所以我无法升级@angular/core
PS:我对ionic/angular完全不熟悉,我不知道我在核心版本
或其他方面是否有问题
注意:我尝试了ng update
,ng update--all
,也尝试了清理卸载和重新安装,但到目前为止没有任何效果
版本:
离子框架:3.9.3
爱奥尼亚应用程序脚本:3.2.3
角形磁芯:^5.2.11
角度编译器CLI:5.2.11
节点:10.15.3
操作系统平台:Windows7
导航器平台:Win32
用户代理:Mozilla/5.0(Windows NT 6.1;Win64;x64)AppleWebKit/537.36(KHTML,类似Gecko)Chrome/73.0.3683.86 Safari/537.36
角度CLI:7.3.8
节点:10.15.3
操作系统:win32 x64
角度:5.2.11
。。。动画、通用、编译器、核心、表单、http
。。。平台浏览器,平台浏览器动态,路由器
软件包版本
@角度devkit/architect 0.13.8
@角度开发套件/构建优化器0.0.35
@角度devkit/core 7.3.8
@角度devkit/示意图7.3.8
@角度/cli 7.3.8
@角度/编译器cli 7.2.12
@示意图/角度7.3.8
@示意图/更新0.13.8
rxjs 5.5.11
打字稿2.6.2
Webpack3.12.0我不确定,但我认为这似乎是一个死锁。您能否手动更新以下版本的
angular
和rxjs
并执行以下操作
npm i
然后尝试更新爱奥尼亚
:
"@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"
我从来没用过爱奥尼亚。但是您使用的是版本3.9.3,这取决于ANgular的版本,该版本比您尝试升级到的版本旧。目前的爱奥尼亚版本是4.2.0。如果你刚开始一个ionic项目,为什么要开始一个旧版本?在中重现这个问题。看起来你在构造函数或函数中提供了一些不需要的参数。另外,如果你在ionic angular中有任何exp,请检查这个qoes,@Vivek:当然,让我检查一下