Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nx failed to create new workspace #27270

Closed
1 of 4 tasks
JCEdward opened this issue Aug 2, 2024 · 7 comments · Fixed by #29122
Closed
1 of 4 tasks

Nx failed to create new workspace #27270

JCEdward opened this issue Aug 2, 2024 · 7 comments · Fixed by #29122
Assignees
Labels
scope: core core nx functionality type: bug

Comments

@JCEdward
Copy link

JCEdward commented Aug 2, 2024

Current Behavior

Create work space with yarn
npx create-nx-workspace test-nx-expo --pm yarn

yarn create nx-workspace --verbose
➤ YN0000: · Yarn 4.3.1
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + create-nx-workspace@npm:19.5.6, ansi-colors@npm:4.1.3, ansi-regex@npm:5.0.1, ansi-styles@npm:4.3.0, asynckit@npm:0.4.0, axios@npm:1.7.3, base64-js@npm:1.5.1, bl@npm:4.1.0, and 48 more.
➤ YN0000: └ Completed in 0s 466ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 56 packages were added to the project (+ 4.07 MiB).
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0000: └ Completed in 0s 470ms
➤ YN0000: · Done with warnings in 1s 32ms


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

√ Where would you like to create your workspace? · org
√ Which stack do you want to use? · angular
√ Integrated monorepo, or standalone project? · integrated
√ Application name · org
√ Which bundler would you like to use? · esbuild
√ Default stylesheet format · scss
√ Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)? · No
√ Test runner to use for end to end (E2E) tests · playwright
√ Which CI provider would you like to use? · github

 NX   Creating your v19.5.6 workspace.

✔ Installing dependencies with yarn
✖ Creating your workspace in org

 NX   Failed to create a workspace.

Exit code: 1
Log file: C:\Users\chien\AppData\Local\Temp\tmp-8876-UP6RO6Te6NWk\error.log

Expected Behavior

I should be creating an Nx workspace successfully.

GitHub Repo

No response

Steps to Reproduce

run yarn create nx-workspace --verbose

Nx Report

I cant create proj to run nx report

Failure Logs

NX   spawnSync C:\Windows\system32\cmd.exe ENOENT


Error: spawnSync C:\Windows\system32\cmd.exe ENOENT
    at Object.spawnSync (node:internal/child_process:1124:20)
    at spawnSync (node:child_process:876:24)
    at execSync (node:child_process:957:15)
    at C:\Users\chien\AppData\Local\Temp\tmp-2876-OdDrTz3Lo5Ax\node_modules\@nx\workspace\src\generators\new\new.js:19:46
    at C:\Users\chien\AppData\Local\Temp\tmp-2876-OdDrTz3Lo5Ax\node_modules\nx\src\command-line\new\new.js:26:19
    at async handleErrors (C:\Users\chien\AppData\Local\Temp\tmp-2876-OdDrTz3Lo5Ax\node_modules\nx\src\utils\params.js:22:24)
    at async Object.handler (C:\Users\chien\AppData\Local\Temp\tmp-2876-OdDrTz3Lo5Ax\node_modules\nx\src\command-line\new\command-object.js:10:22)

Package Manager Version

yarn 4.3.1

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

NX spawnSync C:\Windows\system32\cmd.exe ENOENT

Error: spawnSync C:\Windows\system32\cmd.exe ENOENT
at Object.spawnSync (node:internal/child_process:1124:20)
at spawnSync (node:child_process:876:24)
at execSync (node:child_process:957:15)
at C:\Users\chien\AppData\Local\Temp\tmp-8876-UP6RO6Te6NWk\node_modules@nx\workspace\src\generators\new\new.js:19:46
at C:\Users\chien\AppData\Local\Temp\tmp-8876-UP6RO6Te6NWk\node_modules\nx\src\command-line\new\new.js:26:19
at async handleErrors (C:\Users\chien\AppData\Local\Temp\tmp-8876-UP6RO6Te6NWk\node_modules\nx\src\utils\params.js:22:24)
at async Object.handler (C:\Users\chien\AppData\Local\Temp\tmp-8876-UP6RO6Te6NWk\node_modules\nx\src\command-line\new\command-object.js:10:22)

@maxisam
Copy link

maxisam commented Aug 2, 2024

Same here. if you switch to npm, it should work.

@JCEdward
Copy link
Author

JCEdward commented Aug 3, 2024

Same here. if you switch to npm, it should work.

yes. i tried npm and it works fine, also i tried yarn on ubuntu. everything works fine

@maxisam
Copy link

maxisam commented Aug 5, 2024

I don't know what it is, but one of our teammate make it work. This is kinda weird.

@FrozenPandaz FrozenPandaz added the scope: core core nx functionality label Aug 9, 2024
@AlanGRutter
Copy link

Trying to create NX workspace v19.5.7 on Ubuntu from within VSCode Powershell terminal.

Command: npx create-nx-workspace --pm pnpm --verbose
Options:
Angular
Integrated
webpack
scss
SSR - yes
playwright
skip
skip

Successfully completes 'Installed dependencies with pnpm' then fails creating workspace. No error displayed even using --verbose

When run in a normal Ubuntu terminal window - works fine.

@maxisam
Copy link

maxisam commented Aug 12, 2024

we used Windows

@santoshyadavdev
Copy link
Contributor

I am experiencing something similar with Mac

Screenshot 2024-08-18 at 22 24 28

@AkbarKarshiev
Copy link

AkbarKarshiev commented Dec 3, 2024

I was having similar issue when initializing monorepo and yarn as a package manager on Windows 11. I was able to avoid the issue by initializing new monorepo in C local disk where windows is located thanks to comment in StackOverflow. But I don't know what is the problem exactly, my suspicion is on NodeJS side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: core core nx functionality type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants