reactjs - 做出反应。找不到编译模块失败:无法解析“react-bootsrtap”
问题描述
我开始学习 React。我确实遵循了 youtube 上的几个教程,但是在添加https://react-bootstrap.github.io/时一直面临这个问题。我确实遵循 react-bootsrtap 网站https://react-bootstrap.github.io/getting-started/introduction上提供的所有说明。
当我在控制台中 npm-start 时,我确实看到以下消息:
Failed to compile.
./src/components/Home.jsModule not found: Can't resolve 'react-bootsrtap' in 'C:\Users\Nikolay\desktop\testsite\nikolay\nick\src\components'
当我从我的代码中删除对引导程序的任何引用时,它编译得很好。
Package.json 看起来像这样(注意包含引导程序):
{
"name": "nick",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"bootstrap": "^3.4.1",
"react": "^16.13.1",
"react-bootstrap": "^1.0.1",
"react-dom": "^16.13.1",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
请不要建议跑步
npm install --save react-bootstrap bootstrap
代替
npm install react-bootstrap bootstrap
因为它没有帮助
谢谢!
解决方案
推荐阅读
- jquery - jquery删除(div)中的id
- docker - ip路由规则解读
- python - python - 正则表达式仅适用于单个单词
- firebase - 为了安全起见,我们应该在哪里保存 chrome 扩展中的 Api 配置?
- shell - 如何排列数据线
- database - Symfony 3 - CKEditor 没有正确保存在数据库中
- jquery - 如何使用 jquery 禁用 html 中的部分?
- ksqldb - 是否有可能在运行 KSQL 脚本之前从外部设置参数?
- android - 如何从 kotlin 中收到的短信中获取完整的正文?
- c - 如何删除多次出现的字符并只留下一个