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

执行prisma deploy报错:Cluster undefined does not exist 求助

Fixing "Cluster undefined does not exist" Error with prisma deploy

Hey there, I’ve run into this exact issue before when working with Prisma—let’s get you past this error so you can keep moving with your GraphQL tutorial!

First, let’s recap your situation to make sure I’m on the same page:

You’re following a React-Apollo GraphQL tutorial, installed Prisma globally with npm install -g prisma, and when running prisma deploy in your server directory, you hit this error:

Error: Cluster undefined does not exist.
at Deploy.<anonymous> (/usr/local/lib/node_modules/prisma/node_modules/prisma-cli-core/src/commands/deploy/index.ts:175:13)
...

This error almost always boils down to Prisma not having a valid cluster configured in your prisma.yml file. Here’s how to fix it step by step:

1. Verify your prisma.yml configuration

Head to your server/database/prisma.yml file and make sure it includes a cluster field that matches your setup:

  • If you’re using a local Prisma server (running via Docker), your config should look something like this:
    endpoint: http://localhost:4466/hackernews-react-apollo/dev
    cluster: local
    datamodel: datamodel.prisma
    
  • If you’re using a Prisma Cloud cluster, replace local with the name of your cluster (you can find this in your Prisma Cloud dashboard).

The key here is that the cluster field can’t be missing or set to undefined—that’s exactly what’s causing the error.

2. Ensure your Prisma cluster is accessible

  • For local clusters: Check if your Docker container is running by running docker ps. If you don’t see a prisma/prisma container listed, start it with docker-compose up -d (assuming you have a docker-compose.yml in your server directory).
  • For cloud clusters: Run prisma login in your terminal to re-authenticate, then make sure you select the correct cluster when prompted.

3. Re-initialize Prisma (if needed)

If your prisma.yml looks correct but you’re still getting the error, try re-initializing the Prisma setup in your database directory:

  1. Navigate to server/database
  2. Run prisma init
  3. Follow the prompts to select your cluster (local or cloud)
  4. Once the new prisma.yml is generated, run prisma deploy again

This should overwrite any misconfigured settings and get you up and running.

Let me know if any of these steps resolve your issue—happy to help if you hit any other snags!

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.29 08:07:01