Module not found: Can't resolve 'bootstrap/dist/css/bootstrap-theme.css' in 'C:\react-form-validation-demo\src'


 

此錯誤是由配置錯誤、版本不匹配或引導安裝損壞引起的。如果已經安裝了引導程序和反應引導程序,則可以通過以下方式進行更改:

npm install --save bootstrap@^4.0.0-alpha.6 react-bootstrap@^0.32.1

(檢查package.json是否包含“bootstrap”和“react bootstrap”(如果不確定),只需安裝不同版本的bootstrap並重新構建項目。它應該替換或添加該文件(bootstrap/dist/css/bootstrap theme.css)到該文件夾中。根據我的create react app generated readme.md中的建議,引導程序的較低版本對我有效:

npm install --save react-bootstrap bootstrap@3

Adding Bootstrap

You don’t have to use React Bootstrap together with React but it is a popular library for integrating Bootstrap with React apps. If you need it, you can integrate it with Create React App by following these steps:

Install React Bootstrap and Bootstrap from npm. React Bootstrap does not include Bootstrap CSS so this needs to be installed as well:

sh npm install --save react-bootstrap bootstrap@3

Alternatively you may use yarn:

sh yarn add react-bootstrap bootstrap@3


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM