contoso-real-estate icon indicating copy to clipboard operation
contoso-real-estate copied to clipboard

Unable to run create strapi admin user

Open bplasmeijer opened this issue 10 months ago • 1 comments

Are you accessing the project from the GitHub Codespaces?

  • [ X] No, I am running the project on my local machine (I will fill in the OS section below)
  • [ ] Yes, I am using GitHub Codespaces.

Note: The project is optimized to run on Codespaces. We welcome contributions to enhance it for cross-platform local development, but it's not something we will prioritize right now. Thank you!

Describe the bug Unable to create strapi admin user, and unavailable on the current set-up. Run blog-cms not inside the npm workspace works correctly. Deduped on the graphql package causes the error, 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.

To Reproduce Steps to reproduce the behavior:

docker compose up postgres postgres postgres_setup -d
npm run clean:installl
npm run strapi admin:create -w blog-cms
 npm run strapi admin:create -w blog-cms

> [email protected] strapi
> strapi admin:create

? Admin email? [email protected]
? Admin password? [hidden]
? First name? x
? Last name? y
? Do you really want to create a new admin? Yes
Starting the compilation for TypeScript files in /home/bap/src/contoso-real-estate/packages/blog-cms
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 (/home/bap/src/contoso-real-estate/node_modules/graphql/jsutils/instanceOf.js:43:19)
    at isScalarType (/home/bap/src/contoso-real-estate/node_modules/graphql/type/definition.js:117:37)
    at isNamedType (/home/bap/src/contoso-real-estate/node_modules/graphql/type/definition.js:464:5)
    at SchemaBuilder.addTypes (/home/bap/src/contoso-real-estate/node_modules/nexus/dist/builder.js:270:39)
    at /home/bap/src/contoso-real-estate/node_modules/nexus/dist/builder.js:281:54
    at Array.forEach (<anonymous>)
    at SchemaBuilder.addTypes (/home/bap/src/contoso-real-estate/node_modules/nexus/dist/builder.js:281:32)
    at /home/bap/src/contoso-real-estate/node_modules/nexus/dist/builder.js:278:45
    at Array.forEach (<anonymous>)
    at SchemaBuilder.addTypes (/home/bap/src/contoso-real-estate/node_modules/nexus/dist/builder.js:278:19)
npm ERR! Lifecycle script `strapi` failed with error:
npm ERR! Error: command failed
npm ERR!   in workspace: [email protected]
npm ERR!   at location: /home/bap/src/contoso-real-estate/packages/blog-cms

Expected behavior image

Screenshots If applicable, add screenshots to help explain your problem.

OS (please complete the following information):

  • OS: Windows
  • OS Version: 11
  • npm version: 9.5.0
  • Node.js version: v18.15.0
  • output of azd version:

Additional context Add any other context about the problem here.

bplasmeijer avatar Sep 05 '23 16:09 bplasmeijer

Great analysis, Bart. Thank you and looking forward to your contribution!

anfibiacreativa avatar Sep 05 '23 18:09 anfibiacreativa