【问题标题】:create-react-app is behind the latest versioncreate-react-app 落后于最新版本
【发布时间】:2022-01-18 02:10:27
【问题描述】:
我正在尝试运行:
npx @contentful/create-contentful-app init contentful-refs
但是这会失败并引发以下错误:
您正在运行create-react-app 4.0.3,它落后于最新版本 (5.0.0)。
我们不再支持全局安装 Create React App。
我继续删除了 npm、nvm、npx、create-react-app、create-contentful-app。
我检查它们不在我的机器上,然后我更新到每个的最新版本。并尝试运行初始命令。我仍然遇到同样的问题,现在安装最新版本的 create-react-app 后,我的机器上仍然找不到 create-react-app。不知道在这里做什么,任何帮助将不胜感激。
【问题讨论】:
标签:
javascript
node.js
reactjs
contentful
npx
【解决方案2】:
试试这个命令
npx create-react-app@5.0.0 app-name
【解决方案3】:
试试这个命令。
sudo npm i create-react-app@5.0.0
【解决方案4】:
我也遇到过这个问题,我删除了 _npx 文件夹,然后运行 npx create-react-app my-app 并创建了项目文件夹。
_npx 路径:%\AppData\Local\npm-cache_npx
【解决方案5】:
原来问题出在内容包“@contentful/create-contentful-app”上。最新的 React 更新破坏了他们的包,他们已经对其进行了修复。
【解决方案6】:
如果在全局卸载create-react-app 后问题仍然存在。
试试
npm cache clean -f
或
删除位于以下位置的_npx 文件夹:
C:\Users\<username>\AppData\Local\npm-cache
create-react-app 现在似乎可以工作了
npx create-react-app foo