Error Installing @strapi/plugin-graphql: Duplicate GraphQL Modules Conflict

System Information
  • Strapi Version: 4.17.0
  • Operating System: Windows10
  • Database: PostgreSQL
  • Node Version: 2.10.0
  • NPM Version: 9.2
  • Yarn Version: 1.22.19

Hello,

I’m encountering an issue when installing the @strapi/plugin-graphql plugin in my Strapi project. After running npm install @strapi/plugin-graphql and then npm start, I get an error related to GraphQL. Here’s the error message:

npm start

> backend@0.1.0 start
> strapi start

[2024-01-15 23:59:23.737] debug: ⛔️ Server wasn't able to start properly.
[2024-01-15 23:59:23.740] error: Cannot use GraphQLScalarType "Time" from another module or realm.

Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.

https://yarnpkg.com/en/docs/selective-version-resolutions

Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.
Error: Cannot use GraphQLScalarType "Time" from another module or realm.

Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.

https://yarnpkg.com/en/docs/selective-version-resolutions
Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.
    at instanceOf (C:\Users\wilfr\Documents\Code\Strapi\next-food-delivery-4\backend\node_modules\graphql\jsutils\instanceOf.js:43:19)
    at isScalarType (C:\Users\wilfr\Documents\Code\Strapi\next-food-delivery-4\backend\node_modules\graphql\type\definition.js:117:37)
    at isNamedType (C:\Users\wilfr\Documents\Code\Strapi\next-food-delivery-4\backend\node_modules\graphql\type\definition.js:464:5)
    at SchemaBuilder.addTypes (C:\Users\wilfr\Documents\Code\Strapi\next-food-delivery-4\backend\node_modules\nexus\dist\builder.js:270:39)
    at C:\Users\wilfr\Documents\Code\Strapi\next-food-delivery-4\backend\node_modules\nexus\dist\builder.js:281:54
    at Array.forEach (<anonymous>)
    at SchemaBuilder.addTypes (C:\Users\wilfr\Documents\Code\Strapi\next-food-delivery-4\backend\node_modules\nexus\dist\builder.js:281:32)
    at C:\Users\wilfr\Documents\Code\Strapi\next-food-delivery-4\backend\node_modules\nexus\dist\builder.js:278:45
    at Array.forEach (<anonymous>)
    at SchemaBuilder.addTypes (C:\Users\wilfr\Documents\Code\Strapi\next-food-delivery-4\backend\node_modules\nexus\dist\builder.js:278:19)

Can anyone help me resolve this issue?