3

我正在学习 graphql 并遵循本教程https://www.howtographql.com/react-apollo/1-getting-started/

我已经使用并在服务器文件夹中npm install -g prisma运行此命令时安装了 prisma,但出现此错误:prisma deploy

config CWD /Users/aravind/tekie/hackernews-react-apollo/server +0ms
  config HOME /Users/aravind +2ms
  config definitionDir /Users/aravind/tekie/hackernews-react-apollo/server/database +5ms
  config definitionPath /Users/aravind/tekie/hackernews-react-apollo/server/database/prisma.yml +0ms
  cli { isGlobal: true } +0ms
  StatusChecker setting status checker +0ms
  cli command id deploy +7ms
  cli:plugincache Got plugin from cache +0ms
  cli:plugincache /Users/aravind/Library/Caches/prisma/plugins.json +1ms
  cli:plugincache Got plugin from cache +1ms
  cli:plugincache /Users/aravind/Library/Caches/prisma/plugins.json +0ms
  plugins findCommand prisma-cli-core +0ms
  plugin requiring command +0ms
  cli-engine:plugins:manager requiring /usr/local/lib/node_modules/prisma/node_modules/prisma-cli-core +0ms
  portfinder:defaultHosts exports._defaultHosts is: [ '0.0.0.0', '127.0.0.1', '::1', 'fe80::1', 'fe80::18fb:a4af:2b44:3fea', '192.168.43.100', '2405:204:6209:18b0:144f:bac3:86ac:3cdf', '2405:204:6209:18b0:fd46:e3b7:952f:d569', 'fe80::1c49:3cff:fe5f:7e16', 'fe80::3e5f:ab5d:16dd:a8bf' ] +0ms
  cli-engine:plugins:manager required +538ms
  plugin required command +540ms
  StatusChecker setting status checker +569ms
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)
    at step (/usr/local/lib/node_modules/prisma/node_modules/prisma-cli-core/dist/commands/deploy/index.js:42:23)
    at Object.next (/usr/local/lib/node_modules/prisma/node_modules/prisma-cli-core/dist/commands/deploy/index.js:23:53)
    at fulfilled (/usr/local/lib/node_modules/prisma/node_modules/prisma-cli-core/dist/commands/deploy/index.js:14:58)
    at <anonymous>
  util timed out +0ms
Exiting with code: 0

到目前为止,所有设置都是正确的,我无法运行此命令。任何帮助表示赞赏。

4

2 回答 2

1

我还目睹了您在尝试部署服务时发现的相同问题,遵循相同的教程。

在这个 GitHub 问题中,我偶然发现了教程作者本身的“解决方案” :

本教程的当前版本仅适用于 < 1.7 的 Prisma CLI 版本,因此请确保您安装了一些 1.6.x 版本。您可以使用以下命令检查当前的 prisma 版本:

prisma version

然后像这样卸载并安装正确的版本:

npm uninstall -g prisma

npm install -g prisma@1.6.3

于 2018-07-24T21:35:24.230 回答
-1

下载纱线后,您可以使用纱线棱镜部署运行,而不是使用 npm 棱镜部署

于 2018-05-30T12:36:57.910 回答