nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
22.7k stars 2.27k forks source link

NX Failed to create a workspace #26805

Open pt1c opened 1 week ago

pt1c commented 1 week ago

Current Behavior

Trying to create NX workspace< and then failure:

` $ npx create-nx-workspace@latest

NX Let's create a new workspace [https://nx.dev/getting-started/intro]

√ Where would you like to create your workspace? · project √ Which stack do you want to use? · node √ What framework should be used? · nest √ Integrated monorepo, or standalone project? · integrated √ Application name · account √ Would you like to generate a Dockerfile? [https://docs.docker.com/] · No √ Do you want Nx Cloud to make your CI fast? · skip

NX Creating your v19.4.0 workspace.

✔ Installing dependencies with npm ✖ Creating your workspace in project

NX Failed to create a workspace.

Error: npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported `

Expected Behavior

workspace successfully created

GitHub Repo

No response

Steps to Reproduce

  1. npx create-nx-workspace@latest

Nx Report

Node   : 20.15.0
OS     : win32-x64
npm    : 10.8.1

nx             : 19.4.0
@nx/js         : 19.4.0
@nx/jest       : 19.4.0
@nx/linter     : 19.4.0
@nx/eslint     : 19.4.0
@nx/workspace  : 19.4.0
@nx/devkit     : 19.4.0
@nx/node       : 19.4.0
@nrwl/tao      : 19.4.0
typescript     : 5.4.5

Failure Logs

No response

Package Manager Version

9.2.0

Operating System

Additional Information

No response

GestHairHome commented 1 week ago

Exactly same issue

AgentEnder commented 1 week ago

Hello 👋. Few questions, as this isn't reproducable.

pt1c commented 1 week ago

Hello,

  • Did this generate a new folder containing a package.json?

Yes

  • What other files are present?

image

  • If you try to run install do you get an error?

No.

$ cd project
$ npm i

added 57 packages, changed 2 packages, and audited 554 packages in 4s

63 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
  • If you try to run a generator do you get an error?

Yes

$ npx nx g @nx/nest:module --verbose

 NX   Unable to resolve @nx/nest:module.

Cannot find module '@nx/nest/package.json'
Require stack:
- D:\test\project\node_modules\nx\src\utils\package-json.js
- D:\test\project\node_modules\nx\src\project-graph\plugins\loader.js
- D:\test\project\node_modules\nx\src\project-graph\plugins\index.js
- D:\test\project\node_modules\nx\src\command-line\run\executor-utils.js
- D:\test\project\node_modules\nx\src\devkit-internals.js
- D:\test\project\node_modules\nx\src\utils\assert-workspace-validity.js
- D:\test\project\node_modules\nx\src\project-graph\build-project-graph.js
- D:\test\project\node_modules\nx\src\project-graph\project-graph.js
- D:\test\project\node_modules\nx\src\project-graph\file-utils.js
- D:\test\project\node_modules\nx\src\utils\package-manager.js
- D:\test\project\node_modules\nx\src\utils\child-process.js
- D:\test\project\node_modules\nx\src\command-line\migrate\command-object.js
- D:\test\project\node_modules\nx\src\command-line\nx-commands.js
- D:\test\project\node_modules\nx\bin\init-local.js
- D:\test\project\node_modules\nx\bin\nx.js

Error: Unable to resolve @nx/nest:module.
Cannot find module '@nx/nest/package.json'
Require stack:
- D:\test\project\node_modules\nx\src\utils\package-json.js
- D:\test\project\node_modules\nx\src\project-graph\plugins\loader.js
- D:\test\project\node_modules\nx\src\project-graph\plugins\index.js
- D:\test\project\node_modules\nx\src\command-line\run\executor-utils.js
- D:\test\project\node_modules\nx\src\devkit-internals.js
- D:\test\project\node_modules\nx\src\utils\assert-workspace-validity.js
- D:\test\project\node_modules\nx\src\project-graph\build-project-graph.js
- D:\test\project\node_modules\nx\src\project-graph\project-graph.js
- D:\test\project\node_modules\nx\src\project-graph\file-utils.js
- D:\test\project\node_modules\nx\src\utils\package-manager.js
- D:\test\project\node_modules\nx\src\utils\child-process.js
- D:\test\project\node_modules\nx\src\command-line\migrate\command-object.js
- D:\test\project\node_modules\nx\src\command-line\nx-commands.js
- D:\test\project\node_modules\nx\bin\init-local.js
- D:\test\project\node_modules\nx\bin\nx.js
    at getGeneratorInformation (D:\test\project\node_modules\nx\src\command-line\generate\generator-utils.js:39:15)
    at D:\test\project\node_modules\nx\src\command-line\generate\generate.js:218:248
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async handleErrors (D:\test\project\node_modules\nx\src\utils\params.js:9:24)
    at async Object.handler (D:\test\project\node_modules\nx\src\command-line\generate\command-object.js:13:22)
vqhdev commented 5 days ago

Encounter the same error image image