jquery – Unmet Peer Depedendency poper.js

前端之家收集整理的这篇文章主要介绍了jquery – Unmet Peer Depedendency poper.js前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在使用某些ng-bootstrap下拉组件时遇到问题,因为它依赖于 jquery 3x而后者无法找到popper.js

在我的控制台中看到这个

Uncaught Error: Bootstrap dropdown require Popper.js

我该如何解决这个问题?

使用npm安装jquery显示了对不在npm注册表中的popper.js的依赖性

└── UNMET PEER DEPENDENCY popper.js@^1.11.0

这是我在package.json中的依赖项

"dependencies": {
    "@angular/animations": "^4.2.4","@angular/common": "^4.2.4","@angular/compiler": "^4.2.4","@angular/core": "^4.2.4","@angular/forms": "^4.2.4","@angular/http": "^4.2.4","@angular/platform-browser": "^4.2.4","@angular/platform-browser-dynamic": "^4.2.4","@angular/router": "^4.2.4","@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.1","bootstrap": "^4.0.0-beta","core-js": "^2.4.1","font-awesome": "^4.7.0","jquery": "^3.2.0","rxjs": "^5.4.2","zone.js": "^0.8.14"
  },

谢谢

解决方法

现在可以从npm安装Popper.js:
npm install popper.js --save

猜你在找的jQuery相关文章