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

执行npx create-next-app -e with-tailwindcss仅生成.gitignore和README文件求助

执行npx create-next-app -e with-tailwindcss my-project仅生成部分文件的排查方案

以下是几种常见原因和对应的解决办法:

  • 网络拉取失败
    命令需要从GitHub拉取官方的with-tailwindcss示例模板,网络不稳定或访问限制会导致拉取中断。可以:

    1. 切换至稳定网络,或使用国内npm镜像源执行:
      npx create-next-app -e with-tailwindcss my-project --registry=https://registry.npmmirror.com
      
    2. 手动克隆模板仓库后初始化:
      git clone https://github.com/vercel/next.js.git
      cd next.js/examples/with-tailwindcss
      cp -r . ../../my-project
      cd ../../my-project
      npm install
      
  • 工具版本过旧
    旧版create-next-app可能存在模板拉取逻辑缺陷,先更新工具:

    npm uninstall -g create-next-app
    npm install -g create-next-app
    

    或者直接指定最新版本执行:

    npx create-next-app@latest -e with-tailwindcss my-project
    
  • 本地目录权限不足
    当前工作目录没有写入权限会导致文件生成不全,Windows用管理员命令提示符、Linux/macOS加sudo重新执行命令。

  • npx缓存损坏
    缓存异常可能引发拉取失败,清除缓存后重试:

    npx clear-npx-cache
    
  • 模板路径变更
    若官方模板仓库路径调整,可直接指定完整仓库地址执行:

    npx create-next-app my-project --example https://github.com/vercel/next.js/tree/canary/examples/with-tailwindcss
    

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.26 19:34:55