安装 bootstrap 后 React 应用程序 Localhost 损坏

React apps Localhost broken after installing bootstrap

尽管涉及 localhost 'refuse to connect' 错误的众多问题我相信这是独一无二的,因为它仅在安装 bootstrap 后出现。我花了一段时间才将其作为问题所在。我可以使用以下方法创建一个应用程序:

npx create-react-app 名称

初始化为:

npm start(在正确的目录中)

一切正常。我可以继续这样使用没问题。但是一旦为这个项目安装了 bootstrap:

npm install react-bootstrap bootstrap

可怕的本地主机 'refuse to connect' 错误出现,这会永久破坏项目,奇怪的是,即使在此项目中卸载了 bootstrap。到目前为止,对 localhost 拒绝连接问题的所有故障排除均未成功。

试试这个:

$npx create-react-app name

$cd name 

npm install react-bootstrap bootstrap

npm start