【问题标题】:Strapi Graphql Plugin Crashes Strapi ServerStrapi Graphql 插件崩溃 Strapi 服务器
【发布时间】:2020-04-17 05:46:12
【问题描述】:

我刚刚尝试为strapi 安装graphql 插件(即strapi-plugin-graphql)。当我尝试通过管理界面安装它时,我收到以下错误消息:

重启的时间比预期的要长 服务器应该已经重新启动,请在终端中检查您的日志

当我检查我的终端时,我看到的是这样的:

[2019-12-27T07:47:12.612Z] debug GET /admin/plugins (5 ms) 200
[2019-12-27T07:47:15.882Z] info Installing graphql...
[2019-12-27T07:48:59.105Z] info File changed: C:\code\tutorials\react\Gatsby\strapi\startup-reporter\package.json[2019-12-27T07:48:59.279Z] debug POST /admin/plugins/install (103411 ms) 200
[2019-12-27T07:48:59.281Z] info The server is restarting

[2019-12-27T07:49:14.672Z] debug ⛔️ Server wasn't able to start properly.
[2019-12-27T07:49:14.674Z] error Error: Field "Query.news" can only be defined once.
    at assertValidSDL (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\graphql\validation\validate.js:108:11)
    at Object.buildASTSchema (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\graphql\utilities\buildASTSchema.js:71:34)
    at Object.buildSchemaFromTypeDefinitions (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\graphql-tools\dist\generate\buildSchemaFromTypeDefinitions.js:23:28)
    at makeExecutableSchema (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\graphql-tools\dist\makeExecutableSchema.js:26:29)
    at Object.generateSchema (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\strapi-plugin-graphql\services\Schema.js:300:22)
    at Object.initialize (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\strapi-plugin-graphql\hooks\graphql\index.js:59:50)
    at Promise.resolve.then (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\strapi\lib\hooks\index.js:37:28)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! startup-reporter@0.1.0 dev: `strapi develop`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the startup-reporter@0.1.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\moshe\AppData\Roaming\npm-cache\_logs\2019-12-27T07_49_14_697Z-debug.log

知道为什么我会收到此错误消息以及如何解决它吗?

更新: 我应该注意到我重新安装了strapi,然后安装了graphql插件——它安装正确。它仅不适用于已经具有自定义帖子类型的安装。我不知道为什么会这样 - 以及我可以做些什么来使用这些自定义帖子类型安装它。有什么想法吗?

【问题讨论】:

    标签: strapi


    【解决方案1】:

    这是关于这个问题的问题

    https://github.com/strapi/strapi/issues/1198

    pluralize 版本有些词管理不善。

    所以问题是由于这一点。

    目前无法自行修复。

    【讨论】:

      猜你喜欢
      • 2018-10-22
      • 2020-03-09
      • 2021-03-09
      • 2018-06-04
      • 2018-10-16
      • 2020-03-20
      • 2020-05-08
      • 1970-01-01
      • 2022-01-09
      相关资源
      最近更新 更多