Angularjs   发布时间:2022-04-20  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了angularjs2启动项目报ERROR in AppModule is not an NgModule解决方法大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如图:


这主要是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运行

大佬总结

以上是大佬教程为你收集整理的angularjs2启动项目报ERROR in AppModule is not an NgModule解决方法全部内容,希望文章能够帮你解决angularjs2启动项目报ERROR in AppModule is not an NgModule解决方法所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: