得到错误:找不到模块'react-bootstrap-modal'的声明文件.在反应中

Nik*_*hal 3 reactjs

我是新来的reactjs,我已安装npm install react-bootstrap-modal 当我使用它时var Modal = require('react-bootstrap-modal'),它给我下面的错误,有谁可以请帮助我,我需要做什么呢?

Could not find a declaration file for module 'react-bootstrap-modal'. 'd:/wamp64/www/my-app/node_modules/react-bootstrap-modal/lib/Modal.js' implicitly has an 'any' type.Try `npm install @types/react-bootstrap-modal` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-bootstrap-modal';` [7016]

Try `npm install @types/react-bootstrap-modal` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-bootstrap-modal';` [7016]
Run Code Online (Sandbox Code Playgroud)

Ris*_*abh 6

没有为react-bootstrap-modal安装范围类型定义尝试安装它们:

npm install --save-dev @types/node 
npm install --save @types/react-bootstrap
Run Code Online (Sandbox Code Playgroud)

软件包的类型版本由开源社区DefinitelyTyped维护.(对于Typescript 2.0+) https://github.com/DefinitelyTyped/DefinitelyTyped