我运行命令ng update
We analyzed your package.json, there are some packages to update: Name Version Command to update ----------------------------------------------------------------------------------- @angular/core 9.0.7 -> 9.1.0 ng update @angular/core所以我运行ng update @angular/core并显示Package '@angular/core' is already up to date.如何解决此问题?
so I run ng update @angular/core and it says Package '@angular/core' is already up to date. How can I resolve this issue?
Angular CLI: 9.1.0 Node: 13.9.0 OS: win32 x64 Angular: 9.1.0 ... cli, core, forms, localize Ivy Workspace: Yes Package Version ------------------------------------------------------------- @angular-devkit/architect 0.900.7 @angular-devkit/build-angular 0.900.7 @angular-devkit/build-optimizer 0.900.7 @angular-devkit/build-webpack 0.900.7 @angular-devkit/core 9.1.0 @angular-devkit/schematics 9.1.0 @angular/animations 9.0.7 @angular/common 9.0.7 @angular/compiler 9.0.7 @angular/compiler-cli 9.0.7 @angular/language-service 9.0.7 @angular/platform-browser 9.0.7 @angular/platform-browser-dynamic 9.0.7 @angular/router 9.0.7 @ngtools/webpack 9.0.7 @schematics/angular 9.1.0 @schematics/update 0.901.0 rxjs 6.5.4 typescript 3.8.3 webpack 4.41.2我需要@angular/core@9.1.0,所以我可以将TypeScript 3.8.3与ng serve一起使用,因为如果没有它,我目前会遇到类似以下的错误:error TS2314: Generic type 'ɵɵFactoryDef' requires 2 type argument(s)..
I need @angular/core@9.1.0 so I can use TypeScript 3.8.3 with ng serve because I am currently getting errors like these without it: error TS2314: Generic type 'ɵɵFactoryDef' requires 2 type argument(s)..
我尝试使用--force选项删除并重新安装node_modules,指定版本@angular/core@9.1.0,但无济于事.
I have tried deleting and reinstalling node_modules, using the --force option, specifying the version @angular/core@9.1.0, all but to no avail.
推荐答案我遵循了网站,但对于@angular/core:
npm uninstall @angular/core npm cache verify npm install @angular/core@latestng update现在显示We analyzed your package.json and everything seems to be in order. Good work!
npm ls @angular/core向我展示了此内容:
C:\Users\jsmith\AppData\Roaming\npm `-- UNMET PEER DEPENDENCY @angular/core@9.1.0 npm ERR! peer dep missing: @angular/core@9.0.7, required by @angular/forms@9.0.7所以我将package.json中的所有9.0.7替换为9.1.0,然后npm i并解决了我的问题!
So I replace all of 9.0.7 in package.json with 9.1.0, then npm i and my issues are resolved!
更新@angular/core时,似乎所有其他@angular软件包都必须具有相同的版本,无论是否使用^.
When you update @angular/core, it seems that all other @angular packages need to have the same version, regardless of ^ being used or not.
更多推荐
ng update从不更新@ angular/core版本
发布评论