Angular 找不到模块';bootstrap/dist/js/bootstrap';

Angular 找不到模块';bootstrap/dist/js/bootstrap';,angular,twitter-bootstrap,angular-ui-bootstrap,bootstrap-5,Angular,Twitter Bootstrap,Angular Ui Bootstrap,Bootstrap 5,我试图在angular 11项目中使用bootstrap js,当我在我的组件类中导入bootstrap类/js时,我发现下面的错误 这不是在Bootstrap5Alpha中发生的,而是在最终版本中发生的,知道吗 Error: src/app/components/ba-carousel/ba-carousel.component.ts:3:23 - error TS7016: Could not find a declaration file for module 'bootstrap/dis

我试图在angular 11项目中使用bootstrap js,当我在我的组件类中导入bootstrap类/js时,我发现下面的错误

这不是在Bootstrap5Alpha中发生的,而是在最终版本中发生的,知道吗

Error: src/app/components/ba-carousel/ba-carousel.component.ts:3:23 - error TS7016: Could not find a declaration file for module 'bootstrap/dist/js/bootstrap'. '/Users/aniruddh/bootstrap-angular/node_modules/bootstrap/dist/js/bootstrap.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/bootstrap` if it exists or add a new declaration (.d.ts) file containing `declare module 'bootstrap/dist/js/bootstrap';`

3 import Bootstrap from 'bootstrap/dist/js/bootstrap';
 
组件代码:

import {Component, OnInit, ViewChild} from '@angular/core';

import Bootstrap from 'bootstrap/dist/js/bootstrap';

@Component({
  selector: 'app-ba-carousel',
  templateUrl: './ba-carousel.component.html',
  styleUrls: ['./ba-carousel.component.scss']
})
export class BaCarouselComponent implements OnInit {

  modalDirect: Bootstrap.Modal;
  @ViewChild('demoModal') input;
  constructor() { }

  ngOnInit(): void {
  }

}


你厌倦了安装引导类型吗?尝试
npm i--save dev@types/bootstrap
@enno.void是的,已经安装并能够成功地在webstorm中自动完成