Closed suntong closed 3 years ago
Hi there! I had a similar problem running Gatsby and was able to solve it by installing nvm
which allows me to have multiple versions of node on the same machine.
I installed node 14 as well as node 10 and when I run the gatsby site locally, I simply run nvm use 14
first.
Hope that helps!
Tutorial for getting started not working for me:
and I got:
Log error Details
``` # under .../jamstack/gatsby/agility-gatsby-starter $ gatsby develop success open and validate gatsby-configs - 0.085s success load plugins - 9.727s success onPreInit - 0.005s success initialize cache - 0.020s success copy gatsby files - 1.098s success onPreBootstrap - 0.141s success createSchemaCustomization - 0.008s ERROR #11321 PLUGIN "@agility/gatsby-source-agilitycms" threw an error while running the sourceNodes lifecycle: You must provide an guid. 16 | 17 | //set up our Agility CMS Sync Client > 18 | const syncClient = agilitySync.getSyncClient({ | ^ 19 | guid: configOptions.guid, 20 | apiKey: configOptions.apiKey, 21 | isPreview: configOptions.isPreview, File: node_modules/@agility/gatsby-source-agilitycms/gatsby-node.js:18:33 TypeError: You must provide an guid. - agility-sync-sdk.node.js:9367 validateConfigParams [agility-gatsby-starter]/[@agility]/content-sync/dist/agility-sync-sdk.node.js:93 67:11 - agility-sync-sdk.node.js:9360 Object.getSyncClient [agility-gatsby-starter]/[@agility]/content-sync/dist/agility-sync-sdk.node.js:93 60:3 - gatsby-node.js:18 Object.exports.sourceNodes [agility-gatsby-starter]/[@agility]/gatsby-source-agilitycms/gatsby-node.js:18:33 - api-runner-node.js:229 runAPI [agility-gatsby-starter]/[gatsby]/src/utils/api-runner-node.js:229:22 - api-runner-node.js:339 resolve [agility-gatsby-starter]/[gatsby]/src/utils/api-runner-node.js:339:17 - debuggability.js:384 Promise._execute [agility-gatsby-starter]/[bluebird]/js/release/debuggability.js:384:9 - promise.js:518 Promise._resolveFromExecutor [agility-gatsby-starter]/[bluebird]/js/release/promise.js:518:18 - promise.js:103 new Promise [agility-gatsby-starter]/[bluebird]/js/release/promise.js:103:10 - api-runner-node.js:338 Promise.mapSeries.plugin [agility-gatsby-starter]/[gatsby]/src/utils/api-runner-node.js:338:14 - util.js:16 tryCatcher [agility-gatsby-starter]/[bluebird]/js/release/util.js:16:23 - reduce.js:166 Object.gotValue [agility-gatsby-starter]/[bluebird]/js/release/reduce.js:166:18 - reduce.js:155 Object.gotAccum [agility-gatsby-starter]/[bluebird]/js/release/reduce.js:155:25 - util.js:16 Object.tryCatcher [agility-gatsby-starter]/[bluebird]/js/release/util.js:16:23 - promise.js:547 Promise._settlePromiseFromHandler [agility-gatsby-starter]/[bluebird]/js/release/promise.js:547:31 - promise.js:604 Promise._settlePromise [agility-gatsby-starter]/[bluebird]/js/release/promise.js:604:18 - promise.js:649 Promise._settlePromise0 [agility-gatsby-starter]/[bluebird]/js/release/promise.js:649:10 warn The @agility/gatsby-source-agilitycms plugin has generated no Gatsby nodes. Do success source and transform nodes - 0.504s warn `createResolvers` passed resolvers for type `agilitypage` that doesn't exist in warn `createResolvers` passed resolvers for type `agilityitem` that doesn't exist in warn `createResolvers` passed resolvers for type `agilityPost` that doesn't exist in success building schema - 0.397s AgilityCMS => Create Pages Started... ERROR #11321 PLUGIN "@agility/gatsby-source-agilitycms" threw an error while running the createPages lifecycle: You must provide an guid. 75 | 76 | //set up our Agility CMS Sync Client > 77 | const syncClient = agilitySync.getSyncClient({ | ^ 78 | guid: configOptions.guid, 79 | apiKey: configOptions.apiKey, 80 | isPreview: configOptions.isPreview, File: node_modules/@agility/gatsby-source-agilitycms/gatsby-node.js:77:33 TypeError: You must provide an guid. - agility-sync-sdk.node.js:9367 validateConfigParams [agility-gatsby-starter]/[@agility]/content-sync/dist/agility-sync-sdk.node.js:93 67:11 - agility-sync-sdk.node.js:9360 Object.getSyncClient [agility-gatsby-starter]/[@agility]/content-sync/dist/agility-sync-sdk.node.js:93 60:3 - gatsby-node.js:77 Object.exports.createPages [agility-gatsby-starter]/[@agility]/gatsby-source-agilitycms/gatsby-node.js:77:33 - api-runner-node.js:229 runAPI [agility-gatsby-starter]/[gatsby]/src/utils/api-runner-node.js:229:22 - api-runner-node.js:339 resolve [agility-gatsby-starter]/[gatsby]/src/utils/api-runner-node.js:339:17 - debuggability.js:384 Promise._execute [agility-gatsby-starter]/[bluebird]/js/release/debuggability.js:384:9 - promise.js:518 Promise._resolveFromExecutor [agility-gatsby-starter]/[bluebird]/js/release/promise.js:518:18 - promise.js:103 new Promise [agility-gatsby-starter]/[bluebird]/js/release/promise.js:103:10 - api-runner-node.js:338 Promise.mapSeries.plugin [agility-gatsby-starter]/[gatsby]/src/utils/api-runner-node.js:338:14 - util.js:16 tryCatcher [agility-gatsby-starter]/[bluebird]/js/release/util.js:16:23 - reduce.js:166 Object.gotValue [agility-gatsby-starter]/[bluebird]/js/release/reduce.js:166:18 - reduce.js:155 Object.gotAccum [agility-gatsby-starter]/[bluebird]/js/release/reduce.js:155:25 - util.js:16 Object.tryCatcher [agility-gatsby-starter]/[bluebird]/js/release/util.js:16:23 - promise.js:547 Promise._settlePromiseFromHandler [agility-gatsby-starter]/[bluebird]/js/release/promise.js:547:31 - promise.js:604 Promise._settlePromise [agility-gatsby-starter]/[bluebird]/js/release/promise.js:604:18 - promise.js:641 Promise._settlePromiseCtx [agility-gatsby-starter]/[bluebird]/js/release/promise.js:641:10 failed createPages - 0.054s success createPagesStatefully - 0.070s success onPreExtractQueries - 0.002s success update schema - 0.033s ERROR #85923 GRAPHQL There was an error in your GraphQL query: Cannot query field "agilitypage" on type "Query". If you don't expect "agilitypage" to exist on the type "Query" it is most likely a typo. However, if you expect "agilitypage" to exist there are a couple of solutions to common problems: - If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server - The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have - You want to optionally use your field "agilitypage" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add a least one entry with that field ("dummy content") It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "Query": https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions File: src/AgilityPage.js:16:5 ERROR #85923 GRAPHQL There was an error in your GraphQL query: Cannot query field "agilityitem" on type "Query". If you don't expect "agilityitem" to exist on the type "Query" it is most likely a typo. However, if you expect "agilityitem" to exist there are a couple of solutions to common problems: - If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server - The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have - You want to optionally use your field "agilityitem" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add a least one entry with that field ("dummy content") It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "Query": https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions File: src/AgilityPage.js:19:5 ERROR #85923 GRAPHQL There was an error in your GraphQL query: Cannot query field "agilityGlobalHeader" on type "Query". If you don't expect "agilityGlobalHeader" to exist on the type "Query" it is most likely a typo. However, if you expect "agilityGlobalHeader" to exist there are a couple of solutions to common problems: - If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server - The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have - You want to optionally use your field "agilityGlobalHeader" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add a least one entry with that field ("dummy content") It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "Query": https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions File: src/components/GlobalHeader.js:10:4 ERROR #85923 GRAPHQL There was an error in your GraphQL query: Cannot query field "allAgilitySitemapNode" on type "Query". If you don't expect "allAgilitySitemapNode" to exist on the type "Query" it is most likely a typo. However, if you expect "allAgilitySitemapNode" to exist there are a couple of solutions to common problems: - If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server - The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have - You want to optionally use your field "allAgilitySitemapNode" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add a least one entry with that field ("dummy content") It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "Query": https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions File: src/components/GlobalHeader.js:15:13 ERROR #85923 GRAPHQL There was an error in your GraphQL query: Cannot query field "allAgilityPost" on type "Query". If you don't expect "allAgilityPost" to exist on the type "Query" it is most likely a typo. However, if you expect "allAgilityPost" to exist there are a couple of solutions to common problems: - If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server - The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have - You want to optionally use your field "allAgilityPost" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add a least one entry with that field ("dummy content") It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "Query": https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions File: src/modules/PostsListing.js:12:13 failed extract queries from components - 0.859s success write out requires - 0.031s success write out redirect data - 0.003s success onPostBootstrap - 0.002s ⠀ info bootstrap finished - 40.175 s ⠀ success run queries - 0.043s - 1/1 23.27/s ⠀ You can now view agility-gatsby-starter in the browser. ⠀ http://localhost:8000/ ⠀ View GraphiQL, an in-browser IDE, to explore your site's data and schema ⠀ http://localhost:8000/___graphql ⠀ Note that the development build is not optimized. To create a production build, use gatsby build ⠀ success Building development bundle - 12.342s ```Then when I tried to access http://localhost:8000/, I got
Http Errors Details
``` http://localhost:8000/ Failed to compile There was an error in your GraphQL query: Cannot query field "agilitypage" on type "Query". If you don't expect "agilitypage" to exist on the type "Query" it is most likely a typo. However, if you expect "agilitypage" to exist there are a couple of solutions to common problems: - If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server - The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have - You want to optionally use your field "agilitypage" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add a least one entry with that field ("dummy content") It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "Query": https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions File: .../jamstack/gatsby/agility-gatsby-starter/src/AgilityPage.js There was an error in your GraphQL query: Cannot query field "agilityitem" on type "Query". If you don't expect "agilityitem" to exist on the type "Query" it is most likely a typo. However, if you expect "agilityitem" to exist there are a couple of solutions to common problems: - If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server - The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have - You want to optionally use your field "agilityitem" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add a least one entry with that field ("dummy content") It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "Query": https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions File: .../jamstack/gatsby/agility-gatsby-starter/src/AgilityPage.js There was an error in your GraphQL query: Cannot query field "agilityGlobalHeader" on type "Query". If you don't expect "agilityGlobalHeader" to exist on the type "Query" it is most likely a typo. However, if you expect "agilityGlobalHeader" to exist there are a couple of solutions to common problems: - If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server - The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have - You want to optionally use your field "agilityGlobalHeader" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add a least one entry with that field ("dummy content") It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "Query": https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions File: .../jamstack/gatsby/agility-gatsby-starter/src/components/GlobalHeader.js There was an error in your GraphQL query: Cannot query field "allAgilitySitemapNode" on type "Query". If you don't expect "allAgilitySitemapNode" to exist on the type "Query" it is most likely a typo. However, if you expect "allAgilitySitemapNode" to exist there are a couple of solutions to common problems: - If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server - The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have - You want to optionally use your field "allAgilitySitemapNode" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add a least one entry with that field ("dummy content") It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "Query": https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions File: .../jamstack/gatsby/agility-gatsby-starter/src/components/GlobalHeader.js There was an error in your GraphQL query: Cannot query field "allAgilityPost" on type "Query". If you don't expect "allAgilityPost" to exist on the type "Query" it is most likely a typo. However, if you expect "allAgilityPost" to exist there are a couple of solutions to common problems: - If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server - The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have - You want to optionally use your field "allAgilityPost" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add a least one entry with that field ("dummy content") It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "Query": https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions File: .../jamstack/gatsby/agility-gatsby-starter/src/modules/PostsListing.js ```PS.
I have to use a fixed node version because the other node app that I have requires specifically such version:
What is your node version? (run
node --version
) Answer: v10.21.0What os are you using Answer: