![](/img/trans.png)
[英]ERROR in The Angular Compiler requires TypeScript >=3.1.1 and <3.2.0 but 3.2.1 was found instead
[英]ERROR WHILE RUNNING ionic serve: [ng] Error: The Angular Compiler requires TypeScript >=4.4.2 and <4.5.0 but 4.5.2 was found instead
我試圖運行 ionic serve 命令,但我不斷收到錯誤消息
[ng] Error: The Angular Compiler requires TypeScript >=4.4.2 and <4.5.0 but 4.5.2 was found instead.
當我嘗試使用此命令降級 typescript
npm install typescript@">=4.4.2 <4.5.0" --save-dev --save-exact
並且還運行npm i
; ionic serve
命令卡在生成瀏覽器應用程序包階段設置。
當我檢查我的 angular 版本時,我得到以下信息:
Angular CLI: 13.0.4
Node: 16.10.0
Package Manager: npm 8.1.4
OS: win32 x64
Angular: 13.0.3
... common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1300.4
@angular-devkit/build-angular 13.0.4
@angular-devkit/core 13.0.4
@angular-devkit/schematics 13.0.4
@angular/cli 13.0.4
@schematics/angular 13.0.4
rxjs 6.5.5
typescript 4.5.2
拜托,我需要一些幫助:
嘗試這個:
typescript 4.4.4
替換typescript 4.5.2
npm i
我有同樣的問題。 這個答案幫助了我。 但它指的是最大版本 12 Angular。 對於版本 13 Angular,我在項目中使用了這個:
npm i -D typescript@4.4
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.