Ath*_*eer 249 javascript reactjs npm-install yarnpkg npx
我在创建 React 应用程序时遇到错误。我如何解决它?
小智 977
尝试运行这个:
npx clear-npx-cache
Run Code Online (Sandbox Code Playgroud)
Ath*_*eer 184
它是固定的。我愿意npx create-react-app@5.0.0 my-app
。
参考:创建新的 React 应用程序时出错(“您正在运行 `create-react-app` 4.0.3,它落后于最新版本 (5.0.0)”)
PHP*_*ies 75
npx clear-npx-cache
为我工作。
尝试npx clear-npx-cache
清除 npx 缓存,然后运行 npx create-react-app your-app。
此外,可能值得尝试使用以下命令强制使用最新版本:
npx create-react-app@latest my-app --use-npm
Run Code Online (Sandbox Code Playgroud)
小智 47
解决了。通过使用此代码:
npx create-react-app@5.0.0 my-app
Run Code Online (Sandbox Code Playgroud)
如果它不起作用,请使用此方法并重试:
C:\Users\your_pc_name\AppData\Roaming\npm-
从缓存中删除所有内容
这可能是本地缓存问题。npm cache clean --force
在终端中使用管理员模式尝试该命令,然后使用相同的命令重试 - npx create-react-app my-app
。
小智 23
请按照以下步骤操作:
\n\n\nnpm uninstall -g 创建-react-app
\n
\n\nnpm 缓存清理 --force\xe2\x80\x9d
\n
\n\nnpm 缓存验证
\n
\n\nnpx 创建反应应用程序我的应用程序
\n
归档时间: |
|
查看次数: |
116673 次 |
最近记录: |