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

使用CLI创建Refine项目失败,报错无法获取源码仓库如何解决?

解决Refine CLI创建应用失败的问题

修复步骤

1. 清理npm缓存后重试

缓存损坏可能导致依赖拉取异常,执行以下命令清理缓存:

npm cache clean --force

之后重新运行创建命令:

npm create refine-app@latest

2. 手动指定模板仓库地址

针对「无法获取源码仓库」的报错,可直接指定Refine官方模板仓库地址:

npx superplate-cli https://github.com/refinedev/refine.git

或使用带模板参数的创建命令:

npm create refine-app@latest my-refine-app -- --template refine

3. 切换包管理器尝试

若npm仍有问题,改用yarn或pnpm执行创建命令:

  • 使用yarn:
yarn create refine-app@latest
  • 使用pnpm:
pnpm create refine-app@latest

4. 检查并配置网络环境

确保网络可正常访问GitHub,若处于受限网络,可配置npm代理:

npm config set proxy http://你的代理地址:端口
npm config set https-proxy http://你的代理地址:端口

完成创建后如需清除代理配置:

npm config delete proxy
npm config delete https-proxy

5. 手动克隆模板初始化

如果以上方法均无效,直接克隆官方模板仓库手动初始化项目:

git clone https://github.com/refinedev/refine.git my-refine-app
cd my-refine-app
npm install

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.12 02:42:19