ng update从不更新@ angular/core版本

编程入门 行业动态 更新时间:2024-10-23 17:31:28
本文介绍了ng update从不更新@ angular/core版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我运行命令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@latest

ng 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版本

本文发布于:2023-11-14 14:55:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1587628.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:版本   update   ng   core   angular

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!