Apollo-IOS构建错误“命令PhaseScriptExecution失败,退出代码非零”

时间:2018-10-23 14:31:47

标签: swift apollo-ios

我正在尝试在Xcode 10上构建示例Apollo-IOS。我已经按照文档中描述的所有步骤进行操作:

Apolo-IOS getting started

出现以下错误

timeFormat

好像我的++ npx --no-install apollo codegen:generate --queries=./GraphQL/Queries.graphql --schema=schema.json API.swift --passthroughCustomScalars [?25l[22:26:11] Loading Apollo config [started] [22:26:11] Loading Apollo config [completed] [22:26:11] Resolving GraphQL document sets and dependencies [started] [22:26:11] Scanning for GraphQL queries (1 found) [title changed] [22:26:11] Scanning for GraphQL queries (1 found) [completed] [22:26:11] Generating query files [started] [22:26:11] Generating query files with 'swift' target [title changed] [22:26:11] Generating query files with 'swift' target [failed] [22:26:11] → Cannot read property 'getType' of undefined [?25hTypeError: Cannot read property 'getType' of undefined at typeFromAST (/Volumes/Data/OneDrive/IOS/Source/GraphQL/JediArchives/JediArchives-Final/node_modules/graphql/utilities/typeFromAST.js:41:19) at TypeInfo.enter (/Volumes/Data/OneDrive/IOS/Source/GraphQL/JediArchives/JediArchives-Final/node_modules/graphql/utilities/TypeInfo.js:153:74) at Object.enter (/Volumes/Data/OneDrive/IOS/Source/GraphQL/JediArchives/JediArchives-Final/node_modules/graphql/language/visitor.js:363:16) at Object.visit (/Volumes/Data/OneDrive/IOS/Source/GraphQL/JediArchives/JediArchives-Final/node_modules/graphql/language/visitor.js:254:26) at getValidationErrors (/Volumes/Data/OneDrive/IOS/Source/GraphQL/JediArchives/JediArchives-Final/node_modules/apollo/lib/validation.js:21:15) at Object.validateQueryDocument (/Volumes/Data/OneDrive/IOS/Source/GraphQL/JediArchives/JediArchives-Final/node_modules/apollo/lib/validation.js:26:30) at Object.generate [as default] (/Volumes/Data/OneDrive/IOS/Source/GraphQL/JediArchives/JediArchives-Final/node_modules/apollo/lib/generate.js:19:18) at Task.task (/Volumes/Data/OneDrive/IOS/Source/GraphQL/JediArchives/JediArchives-Final/node_modules/apollo/lib/commands/codegen/generate.js:98:64) at Promise.resolve.then.then.skipped (/Volumes/Data/OneDrive/IOS/Source/GraphQL/JediArchives/JediArchives-Final/node_modules/listr/lib/task.js:167:30) [?25hCommand PhaseScriptExecution failed with a nonzero exit code Queries.graphql在正确的位置,可以通过运行脚本找到。任何人都知道错误是什么以及如何解决(我已将最新的schema.json更新为1.9.2)

1 个答案:

答案 0 :(得分:1)

我遇到了同样的问题。
我签出了仅在安装时运行脚本,并且解决了该问题。 检查您是否勾选了该复选框仅在安装时运行脚本 enter image description here