我只是尝试为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插件--并正确安装了它。它只对已经具有自定义post类型的安装不起作用。我不知道为什么--我能做些什么来用那些定制的post类型来安装它。有什么想法吗?
发布于 2019-12-27 11:43:45
这是关于这个问题的问题
https://github.com/strapi/strapi/issues/1198
有些单词在pluralize版本中没有得到很好的管理。
所以这个问题就是因为这一点。
目前没有什么可做的,可以自己修复它。
https://stackoverflow.com/questions/59497640
复制相似问题