正如 cmets 中的原始海报所述,解决方法可能是清除缓存。
npm cache clean --force
如果还是不行,你可以按照下面的步骤安装 Yarn 试试:
如果 npx create-react-app my-app 和 npm init react-app my-app 都不适合你,试试 Yarn 看看效果如何。
我在 Windows、Ubuntu、Mint 和 macOS 上使用过 CRA 是多个项目,并且从未明确安装过 rxjs,也没有被要求安装它。这使我认为这个问题几乎可以肯定是由 you 的某个地方引起的,而不是 CRA 的某个错误。我假设你已经在 Github 上搜索过他们的问题。
试试 Yarn
打开一个新的终端(linux 和 macOS)或命令行(Windows)会话,cd'd 到您的文档文件夹或合适的替代方案。然后运行:
macOS
brew install yarn
yarn create react-app my-app
Windows(带有 Chocolatey)
choco install yarn
yarn create react-app my-app
Ubuntu
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
yarn create react-app my-app