【问题标题】:Node version problem with Yarn and typescript <error>Yarn 和 typescript <error> 的节点版本问题
【发布时间】:2020-12-09 18:42:32
【问题描述】:

我在我的 Angular 项目上运行 Yarn 时遇到了这个错误

@coreui/coreui-pro-angular-admin-template@2.4.3: The engine "node" is incompatible with this module. Expected version ">= ^8.9.4". Got "10.15.2"

node --version

v10.15.2

ng --version

    Angular CLI: 8.3.17
Node: 10.15.2
OS: win32 x64
Angular: <error>
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, http, language-service, platform-browser
... platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.803.17 (cli-only)
@angular-devkit/build-angular   <error>
@angular-devkit/core            8.3.17 (cli-only)
@angular-devkit/schematics      8.3.17 (cli-only)
@schematics/angular             8.3.17 (cli-only)
@schematics/update              0.803.17 (cli-only)
rxjs                            6.4.0 (cli-only)
typescript                      <error>

这是什么意思,我该如何解决这个问题

【问题讨论】:

    标签: node.js angular yarnpkg


    【解决方案1】:

    你的包 coreui-pro-angular-admin-template 可能已经过时了。

    尝试更新它:

    yarn upgrade coreui-pro-angular-admin-template@latest
    

    通过更新包,它可能会支持节点 10。

    【讨论】:

    • 我已经更新了,但我遇到了同样的错误
    • 你的问题是包版本是2.4.3,最新版本是2.9.3。也许您可以尝试更新到该版本。
    • 谢谢它在 package.json 中
    【解决方案2】:

    谢谢大家 我发现了问题 它在package.json 我在下面改了

      "engines": {
    "node": ">= ^8.9.4",
    "npm": ">= 5.6.0"
      },
    

    成为

      "engines": {
    "node": ">= ^10.15.2",
    "npm": ">= 5.6.0"
      },
    

    谢谢大家

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-21
      • 2015-03-06
      • 1970-01-01
      • 2022-11-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-23
      相关资源
      最近更新 更多