加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs2启动项目报ERROR in AppModule is not an NgModule解

发布时间:2020-12-17 09:14:57 所属栏目:安全 来源:网络整理
导读:如图: 这主要是 ts编译器版本问题,一般是因为ts编译器版本过高导致。 解决方式: npm uninstall -g typescript npm install -gtypescript@2.2.2 tsc -v 查看安装的typescript版本 修改package.json中的typescript版本为2.2.2 (注明:不要写为 " ^ 2.2.2"

如图:


这主要是ts编译器版本问题,一般是因为ts编译器版本过高导致。


解决方式:

  1. npm uninstall -g typescript
  2. npm install -gtypescript@2.2.2
  3. tsc -v 查看安装的typescript版本
  4. 修改package.json中的typescript版本为2.2.2 (注明:不要写为 " ^ 2.2.2")
  5. 删除node_module
  6. 重新安装cnpm install
  7. npm ls typescript 如果都为typecript版本2.2.2说明正确
  8. ng serve运行

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读