我在使用某些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