Nx can't create project graph (projects in the following directories have no name provided)

Discussão em 'Angular' iniciado por ZOfficial, Janeiro 12, 2025.

  1. ZOfficial

    ZOfficial Guest

    I'm trying to create a monorepo for a project that uses angular and nestjs for a techstack. I used this command to initialize the repo.

    npx create-nx-workspace@latest university_archive --preset=angular I have also tried

    npx create-nx-workspace@latest university_archive --preset=nest


    Immediately after successful build I try to run nx graph but get the error

    NX Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it. See errors below.

    Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.
    ProjectsWithNoNameError: The projects in the following directories have no name provided:
    - apps/university_archive-e2e
    at validateAndNormalizeProjectRootMap (/home/xx/xx/xx/xx/xx/xx-xx/university_archive/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:439:15)
    at mergeCreateNodesResults (/home/xx/xx/xx/xx/xx/xx-xx/university_archive/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:322:9)
    at /home/xx/xx/xx/xx/xx/xx-xx/university_archive/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:267:85
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async processFilesAndCreateAndSerializeProjectGraph (/home/xx/xx/xx/xx/xx/xx-xx/university_archive/node_modules/nx/src/daemon/server/project-graph-incremental-recomputation.js:148:43)
    at async getCachedSerializedProjectGraphPromise (/home/xx/xx/xx/xx/xx/xx-xx/university_archive/node_modules/nx/src/daemon/server/project-graph-incremental-recomputation.js:48:16)
    at async handleRequestProjectGraph (/home/xx/xx/2024/xx/xx/xx-xx/university_archive/node_modules/nx/src/daemon/server/handle-request-project-graph.js:12:24)
    at async handleResult (/home/xx/xx/xxx/xx/xx/xx-xx/university_archive/node_modules/nx/src/daemon/server/server.js:140:16)
    at async handleMessage (/xx/xx/xx/xx/xx/xx/xx-xx/university_archive/node_modules/nx/src/daemon/server/server.js:93:9)
    at async /xx/xx/xx/xx/xx/xx/xx-xx/university_archive/node_modules/nx/src/daemon/server/server.js:59:9



    I have double, triple checked that the name in project.json does correspond.(please don't suggest that as a solution). I have reset nx multiple times, as root even. So please don't suggest that either

    This is the contents of project.json in university_archive-e2e, as generated by npx.

    {
    "name": "university_archive-e2e",
    "$schema": "../../node_modules/nx/schemas/project-schema.json",
    "projectType": "application",
    "sourceRoot": "apps/university_archive-e2e/src",
    "tags": [],
    "implicitDependencies": ["university_archive"],
    "// targets": "to see all targets run: nx show project university_archive-e2e --web",
    "targets": {}
    }



    This is my project structure:

    -university_archive
    ---apps
    -----university_archive
    --------project.json
    --------src
    --------other files etc..
    -----university_archive-e2e
    --------src
    --------project.json
    --------other files etc...
    ---package.json
    ---node_modules
    ---.nx
    ---nx.json


    Im using

    • node v20.16.0
    • npm v10.8.1
    • npx v10.8.1
    • nx v19.5.7
    • Ubuntu v22.04.4 LTS

    The issue seems related to this on github issue

    I Have tried their suggestions but they dont work :(

    I have re-built/re-done the project creation more times than I can count. I Tried gpt, claude and gemini This is my last hope...

    Continue reading...

Compartilhe esta Página