代码之家  ›  专栏  ›  技术社区  ›  K.Z

全局angular cli版本(7.2.2)大于本地版本

  •  0
  • K.Z  · 技术社区  · 6 年前

    我正在研究angular 2应用程序,并在尝试使用cli创建组件时出错。

    命令

    ng g c mycomponent
    

    我试图通过执行以下操作来重新安装cli,但它似乎不起作用

    ng new my-project
    cd my-project
    ng g c my-component --m app
    

    错误

    Your global Angular CLI version (7.2.2) is greater than your local
    version (6.0.8). The local Angular CLI version is used.
    
    To disable this warning use "ng config -g cli.warnings.versionMismatch false".
    Could not find an NgModule. Use the skip-import option to skip importing in NgModule.
    

    visual studio代码的ng版本检查

    enter image description here

    命令上的ng版本检查

    enter image description here

    0 回复  |  直到 6 年前
    推荐文章