You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu下执行npx create-react-app my-app无响应问题求助

解决npx create-react-app在Ubuntu终端无响应的问题

可行解决方案:

  • 改用Yarn创建项目
    先全局安装Yarn:

    npm install -g yarn
    

    再通过Yarn初始化React项目:

    yarn create react-app my-app
    
  • 指定create-react-app最新版本执行
    直接指定版本并强制使用npm:

    npx create-react-app@latest my-app --use-npm
    
  • 清理npm缓存
    强制清除缓存后重试原命令:

    npm cache clean --force
    
  • 检查并调整代理设置
    若系统启用了代理,先确认npm的代理配置,必要时临时移除:

    # 查看当前代理配置
    npm config get proxy
    npm config get https-proxy
    # 移除代理配置(如有)
    npm config delete proxy
    npm config delete https-proxy
    
  • 切换npm镜像源(针对网络访问受限场景)
    切换到国内镜像源后重试:

    npm config set registry https://registry.npmmirror.com
    

    之后再执行npx create-react-app my-app

内容的提问来源于stack exchange,提问作者Aamir Khan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.08 06:14:50