Skip to content

Strapi CLI generate command saving files in node_modules/strapi/@generators/dist #22127

@gabrielrra

Description

@gabrielrra

Bug report

Required System information

  • Node.js version: v18.20.4
  • NPM version: 10.7.0
  • Strapi version: 5.2.0
  • Database: mysql
  • Operating system: linux-x64 - Ubuntu 24.04.1 LTS
  • Is your project Javascript or Typescript: Typescript

Describe the bug

While running the strapi cli using yarn (yarn strapi generate) the files generated end up being stored under node_modules/strapi/@generators/dist

Steps to reproduce the behavior

  1. Create a new strapi project using the cli yarn create strapi
  2. Try to generate a new API endpoint using the CLI yarn strapi generate following all the necessary steps
  3. It will succeed but the files won't be in src/api folder
  4. Try to generate the API endpoint again using the same name
  5. It will fail and print the location of the files previously generated

Expected behavior

The files should be generated at the folder src

Screenshots

image

Code snippets

N/A

Additional context

Tried the command using npx, npm run and yarn, all yielding the same result

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: bugIssue reporting a bugseverity: highIf it breaks the basic use of the productsource: cliSource is cli packagestatus: confirmedConfirmed by a Strapi Team member or multiple community membersversion: 5Issue is present in Strapi 5

    Type

    No type

    Projects

    Status

    Fixed/Shipped

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions