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

使用npx create-expo-app加载Realm Expo模板失败,求解决方案

解决使用npx create-expo-app加载@realm/expo-template-js模板的问题

以下是几种可行的解决方法,按优先级尝试:

  • 清理Expo缓存后重试
    缓存损坏可能导致模板读取失败,先执行缓存清理命令:

    npx expo start --clear
    

    之后重新运行初始化命令:

    npx create-expo-app ReactRealmJSTemplateApp -t @realm/expo-template-js
    
  • 指定模板最新版本
    未指定版本时可能拉取到不兼容的旧版本,尝试明确指定latest版本:

    npx create-expo-app ReactRealmJSTemplateApp -t @realm/expo-template-js@latest
    
  • 手动安装模板后加载本地版本
    先将模板包安装到本地项目目录,再从本地加载模板:

    # 创建项目目录并进入
    mkdir ReactRealmJSTemplateApp && cd ReactRealmJSTemplateApp
    # 安装模板包
    npm install @realm/expo-template-js --save-dev
    # 从本地模板初始化项目
    npx create-expo-app . -t ./node_modules/@realm/expo-template-js
    
  • 切换包管理器尝试
    若npm出现读取问题,换用yarn或pnpm执行初始化:

    # 使用yarn
    yarn create expo-app ReactRealmJSTemplateApp -t @realm/expo-template-js
    # 使用pnpm
    pnpm create expo-app ReactRealmJSTemplateApp -t @realm/expo-template-js
    
  • 检查环境版本兼容性
    确保你的Node.js版本≥16.x,npm版本≥8.x,低版本环境可能存在模板加载的兼容性问题,升级后再重试。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.14 17:13:21