next-shopify-storefront icon indicating copy to clipboard operation
next-shopify-storefront copied to clipboard

Startup error reports conflicting versions of graphql

Open rhys-vdw opened this issue 4 years ago โ€ข 1 comments

Hey, just getting started with this project and hitting an issue straight away:

$ npm run dev

> [email protected] dev
> nps -s dev

[next] nps is executing `next` : next dev
[graphql] nps is executing `graphql` : nps graphql.download && nps "graphql.codegen --watch"
[next] ready - started server on 0.0.0.0:3000, url: http://localhost:3000
[next] info  - Loaded env from C:\Users\rhysv\Projects\next-shopify-storefront\.env
[graphql] nps is executing `graphql.download` : apollo client:download-schema -c src/services/shopify/apollo.config.js src/services/shopify/schema.gql
[next] info  - Using webpack 4. Reason: webpack5 flag is set to false in next.config.js https://nextjs.org/docs/messages/webpack5
[graphql]  ยป   Warning: apollo update available from 2.33.6 to 2.33.7.
[graphql] Loading Apollo Project [started]
[next] info  - Using external babel configuration from C:\Users\rhysv\Projects\next-shopify-storefront\.babelrc
[graphql] Loading Apollo Project [completed]
[graphql] Saving schema to src/services/shopify/schema.gql [started]
[graphql] Saving schema to src/services/shopify/schema.gql [failed]
[graphql] โ†’ Cannot use GraphQLNonNull "String!" from another module or realm.
[graphql]
[graphql] Ensure that there is only one instance of "graphql" in the node_modules
[graphql] directory. If different versions of "graphql" are the dependencies of other
[graphql] relied on modules, use "resolutions" to ensure only one version is installed.
[graphql]
[graphql] https://yarnpkg.com/en/docs/selective-version-resolutions
[graphql]
[graphql] Duplicate "graphql" modules cannot be used at the same time since different
[graphql] versions may have different capabilities and behavior. The data from one
[graphql] version used in the function from another could produce confusing and
[graphql] spurious results.
[graphql]     Error: Cannot use GraphQLNonNull "String!" from another module or realm.
[graphql]
[graphql]     Ensure that there is only one instance of "graphql" in the node_modules
[graphql]     directory. If different versions of "graphql" are the dependencies of
[graphql]     other
[graphql]     relied on modules, use "resolutions" to ensure only one version is
[graphql]     installed.
[graphql]
[graphql]     https://yarnpkg.com/en/docs/selective-version-resolutions
[graphql]
[graphql]     Duplicate "graphql" modules cannot be used at the same time since
[graphql]     different
[graphql]     versions may have different capabilities and behavior. The data from one
[graphql]     version used in the function from another could produce confusing and
[graphql]     spurious results.
[graphql] The script called "graphql.download" which runs "apollo client:download-schema -c src/services/shopify/apollo.config.js src/services/shopify/schema.gql" failed with exit code 2 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
[graphql] The script called "graphql" which runs "nps graphql.download && nps "graphql.codegen --watch"" failed with exit code 2 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
[graphql] nps graphql exited with code 2
--> Sending SIGTERM to other processes..
[next] nps next exited with code 1

You can see that there is one additional version of graphql as a dependency of apollo-language-server:

$ npm list graphql
[email protected] C:\Users\rhysv\Projects\next-shopify-storefront
โ”œโ”€โ”ฌ @graphql-codegen/[email protected]
โ”‚ โ”œโ”€โ”ฌ @graphql-codegen/[email protected]
โ”‚ โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”œโ”€โ”ฌ @graphql-codegen/[email protected]
โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ”œโ”€โ”ฌ @n1ru4l/[email protected]
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ”œโ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ””โ”€โ”ฌ [email protected]
โ”‚ โ”‚   โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”œโ”€โ”ฌ @graphql-codegen/[email protected]
โ”‚ โ”œโ”€โ”ฌ @graphql-codegen/[email protected]
โ”‚ โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ”‚ โ””โ”€โ”ฌ [email protected]
โ”‚ โ”‚ โ”‚   โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ”œโ”€โ”ฌ @graphql-tools/[email protected]
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”œโ”€โ”ฌ @graphql-codegen/[email protected]
โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”œโ”€โ”ฌ @graphql-codegen/[email protected]
โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”‚ โ”œโ”€โ”ฌ @apollo/[email protected]
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ”œโ”€โ”ฌ @apollographql/[email protected]
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”ฌ @apollographql/[email protected]
โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”ฌ @apollographql/[email protected]
โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”ฌ @apollographql/[email protected]
โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”‚ โ”‚ โ””โ”€โ”ฌ [email protected]
โ”‚ โ”‚ โ”‚   โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ””โ”€โ”€ [email protected] deduped
โ””โ”€โ”€ [email protected]

Not sure if I'm on the right path above, but it's a non-starter for me regardless.

rhys-vdw avatar Nov 01 '21 02:11 rhys-vdw

I had the same error

I was doing npm install

try yarn install instead

Didn't look why there a difference

pdeville-ledger avatar Mar 14 '22 16:03 pdeville-ledger

Hi @pdeville-ledger @pdeville-ledger I have just released Next Shopify Storefront v3 built with TypeScript, Tailwind CSS, Headless UI, Next.js, React.js, Shopify Hydrogen React,... and Shopify Storefront GraphQL API.

I hope it can solve your problems.

VienDinhCom avatar Apr 12 '23 08:04 VienDinhCom