create-react-app 模板未提供,

2exbekwf  于 2个月前  发布在  React
关注(0)|答案(3)|浏览(29)

你好,我正在学习编程,我正在创建一个React应用。它创建了应用,但它给我返回了
A template was not provided. This is likely because you're using an outdated version of create-react-app. Please note that global installs of create-react-app are no longer supported.
You can fix this by running npm uninstall -g create-react-app or yarn global remove create-react-app before using create-react-app again.
我尝试使用npm uninstall -g create-react-app,但它给了我相同的答案,我的create-react-app版本是18.13.2。这里有一些截图,可能会对你有所帮助。

我的create-react-app版本


问题截图
请问有人能帮帮我吗?

cpjpxq1n

cpjpxq1n1#

这也可能是一个缓存问题。在运行 npm uninstall -g create-react-app 之后,你也可以运行 n pm cache clean --force 来清除缓存。this link 涉及到这个问题的堆栈溢出。如果你有任何其他问题,请随时查看并报告回来。

此外,在这个情况下查看 docs 也无妨。

smdnsysy

smdnsysy2#

它给了我同样的答案。

ev7lccsx

ev7lccsx3#

你好,
如果你刚开始学习React,我建议你使用最新版本的React。你可以在终端输入以下命令来实现:

npm init react-app firstapp

确保你在新建的文件夹或环境中执行此操作。希望这对你有所帮助。

相关问题