首页 > 解决方案 > 安装 React Bootstrap - 无法解决

问题描述

我正在使用 npm install --save react-bootstrap 来安装引导程序。

该文档还说将 import 'bootstrap/dist/css/bootstrap.min.css' 放在我已经完成的 index.js 文件中。

我得到一个错误。无法解析“bootstrap/dist/css/bootstrap.min.css”

当我查看 node_modules 时,我没有在任何地方看到引导程序。

谁能告诉我这里发生了什么?

标签: react-bootstrap

解决方案


你需要同时安装 react-bootrap 和 bootstrap@4.6.0

> npm install react-bootstrap bootstrap@4.6.0

https://react-bootstrap.github.io/getting-started/introduction#installation


推荐阅读