angular4引入ngx-bootstrap 出现 Metadata version mismatch for module

问题:
ERROR in Error: Metadata version mismatch for module F:/nodejs/angular4/mybootst
rap3/node_modules/@ng-bootstrap/ng-bootstrap/index.d.ts, found version 4, expect
ed 3, resolving symbol AppModule in F:/nodejs/angular4/mybootstrap3/src/app/app.
module.ts, resolving symbol AppModule in F:/nodejs/angular4/mybootstrap3/src/app
/app.module.ts
原因:
angular与ngx-bootstrap版本不兼容造成的
解决方案
1、npm show ngx-bootstrap@* version
查看所有版本
2、npm i [email protected]
安装低版本的ngx-bootstrap,我的angular4与ngx-bootstrap 2.0完美运行!

猜你喜欢

转载自blog.csdn.net/weixin_42706227/article/details/82563647