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

Failed to create a workspace #28235

Closed
escwxyz opened this issue Oct 2, 2024 · 9 comments · Fixed by #29122
Closed

Failed to create a workspace #28235

escwxyz opened this issue Oct 2, 2024 · 9 comments · Fixed by #29122
Assignees
Labels

Comments

@escwxyz
Copy link

escwxyz commented Oct 2, 2024

Current Behavior

Failed to create a brand new workspace

Expected Behavior

The CLI shall create a new workspace as expected.

GitHub Repo

No response

Steps to Reproduce

  1. In terminal, run npx create-nx-workspace@latest project-name --verbose
  2. After confirming all the options, the CLI returns the following:
 NX   Let's create a new workspace [https://nx.dev/getting-started/intro]

✔ Which stack do you want to use? · react
✔ What framework would you like to use? · nextjs
✔ Integrated monorepo, or standalone project? · integrated
✔ Application name · project-name
✔ Would you like to use the App Router (recommended)? · Yes
✔ Would you like to use the src/ directory? · Yes
✔ Test runner to use for end to end (E2E) tests · playwright
✔ Default stylesheet format · tailwind
✔ Which CI provider would you like to use? · github

 NX   Creating your v19.8.3 workspace.

✔ Installing dependencies with npm
✖ Creating your workspace in project-name

 NX   Failed to create a workspace.

Exit code: 1
Log file: /var/folders/bh/4z9jyg6d1bvgvjb4pp49gpdc0000gn/T/tmp-35801-uHmrFYYxnH0y/error.log

Nx Report

The project is not even created, so the `nx report` is not available at this time.

Failure Logs

NX   protocol mismatch
   3   │
   4   │ AssertionError [ERR_ASSERTION]: protocol mismatch
   5   │     at Object.request (/private/var/folders/bh/4z9jyg6d1bvgvjb4pp49gpdc0000gn/T/tmp-35801-uHmrFYYxnH0y/node_modules/follow-redirects/index.js:541:14)
   6   │     at dispatchHttpRequest (/private/var/folders/bh/4z9jyg6d1bvgvjb4pp49gpdc0000gn/T/tmp-35801-uHmrFYYxnH0y/node_modules/axios/dist/node/axios.cjs:3000:21)
   7   │     at /private/var/folders/bh/4z9jyg6d1bvgvjb4pp49gpdc0000gn/T/tmp-35801-uHmrFYYxnH0y/node_modules/axios/dist/node/axios.cjs:2690:5
   8   │     at new Promise (<anonymous>)
   9   │     at wrapAsync (/private/var/folders/bh/4z9jyg6d1bvgvjb4pp49gpdc0000gn/T/tmp-35801-uHmrFYYxnH0y/node_modules/axios/dist/node/axios.cjs:2670:10)
  10   │     at http (/private/var/folders/bh/4z9jyg6d1bvgvjb4pp49gpdc0000gn/T/tmp-35801-uHmrFYYxnH0y/node_modules/axios/dist/node/axios.cjs:2708:10)
  11   │     at Axios.dispatchRequest (/private/var/folders/bh/4z9jyg6d1bvgvjb4pp49gpdc0000gn/T/tmp-35801-uHmrFYYxnH0y/node_modules/axios/dist/node/axios.cjs:4135:10)
  12   │     at Axios._request (/private/var/folders/bh/4z9jyg6d1bvgvjb4pp49gpdc0000gn/T/tmp-35801-uHmrFYYxnH0y/node_modules/axios/dist/node/axios.cjs:4415:33)
  13   │     at Axios.request (/private/var/folders/bh/4z9jyg6d1bvgvjb4pp49gpdc0000gn/T/tmp-35801-uHmrFYYxnH0y/node_modules/axios/dist/node/axios.cjs:4282:25)
  14   │     at Axios.httpMethod [as post] (/private/var/folders/bh/4z9jyg6d1bvgvjb4pp49gpdc0000gn/T/tmp-35801-uHmrFYYxnH0y/node_modules/axios/dist/node/axios.cjs:4454:19)
  15   │     at Axios.request (/private/var/folders/bh/4z9jyg6d1bvgvjb4pp49gpdc0000gn/T/tmp-35801-uHmrFYYxnH0y/node_modules/axios/dist/node/axios.cjs:4287:41)
  16   │     at async createNxCloudWorkspaceV2 (/private/var/folders/bh/4z9jyg6d1bvgvjb4pp49gpdc0000gn/T/tmp-35801-uHmrFYYxnH0y/node_modules/nx/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js:
       │ 47:22)
  17   │     at async connectToNxCloud (/private/var/folders/bh/4z9jyg6d1bvgvjb4pp49gpdc0000gn/T/tmp-35801-uHmrFYYxnH0y/node_modules/nx/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js:101:44)
  18   │     at async generateWorkspaceFiles (/private/var/folders/bh/4z9jyg6d1bvgvjb4pp49gpdc0000gn/T/tmp-35801-uHmrFYYxnH0y/node_modules/@nx/workspace/src/generators/new/generate-workspace-files.js:138:11)
  19   │     at async newGenerator (/private/var/folders/bh/4z9jyg6d1bvgvjb4pp49gpdc0000gn/T/tmp-35801-uHmrFYYxnH0y/node_modules/@nx/workspace/src/generators/new/new.js:13:28)
  20   │     at async /private/var/folders/bh/4z9jyg6d1bvgvjb4pp49gpdc0000gn/T/tmp-35801-uHmrFYYxnH0y/node_modules/nx/src/command-line/new/new.js:23:22
  21   │     at async handleErrors (/private/var/folders/bh/4z9jyg6d1bvgvjb4pp49gpdc0000gn/T/tmp-35801-uHmrFYYxnH0y/node_modules/nx/src/utils/handle-errors.js:9:24)
  22   │     at async Object.handler (/private/var/folders/bh/4z9jyg6d1bvgvjb4pp49gpdc0000gn/T/tmp-35801-uHmrFYYxnH0y/node_modules/nx/src/command-line/new/command-object.js:10:22)


### Package Manager Version

10.7.0

### Operating System

- [X] macOS
- [ ] Linux
- [ ] Windows
- [ ] Other (Please specify)

### Additional Information

My machine is under a socks5 proxy environment.
@nvinay-litmus7
Copy link

Hi @escwxyz , got any solution? I'm getting one similar issues while creating a workspace using yarn.

npx create-nx-workspace --pm yarn
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? · react
✔ What framework would you like to use? · react-native
✔ Application name · mobile
✔ Test runner to use for end to end (E2E) tests · playwright
✔ Which CI provider would you like to use? · skip
✔ Would you like remote caching to make your build faster? · yes
✔ Will you be using GitHub as your git hosting provider? · Yes

 NX   Creating your v19.8.3 workspace.

✔ Installing dependencies with yarn
✖ Creating your workspace in Org

 NX   Failed to create a workspace.

Exit code: 1
Log file: /var/folders/1m/sv50vh4s6l5fkn_hq_9g_xn00000gp/T/tmp-79467-08gEWEIyk7Si/error.log

And my error log looks like this

yarn run v1.22.22
$ /private/var/folders/1m/sv50vh4s6l5fkn_hq_9g_xn00000gp/T/tmp-79467-08gEWEIyk7Si/node_modules/.bin/nx new --pm=yarn --packageManager=yarn --interactive --standaloneApi --routing --no-skipGit --no-g '--commit.message=Initial commit' --no-allPrompts --no-a --useGitHub --/bin/sh=/Users/n.vinay/.npm/_npx/d2207cf76adb22dc/node_modules/.bin/create-nx-workspace --name=Org --stack=react --preset=react-native --appName=mobile --no-nextAppDir --no-nextSrcDir --e2eTestRunner=playwright --nxCloud=yes --defaultBase=main --nxWorkspaceRoot=/Users/n.vinay/Work/Monorepo
Resolving 1.22.22 to a url...
Downloading https://github.com/yarnpkg/yarn/releases/download/v1.22.22/yarn-1.22.22.js...
Saving it into /Users/n.vinay/Work/Monorepo/Org/.yarn/releases/yarn-1.22.22.cjs...
Updating /Users/n.vinay/Work/Monorepo/Org/.yarnrc...
Done!
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
$ /Users/n.vinay/Work/Monorepo/Org/node_modules/.bin/nx g @nx/workspace:preset --name=mobile --style=css --linter=eslint --preset=react-native --nextAppDir=false --nextSrcDir=false --packageManager=yarn --standaloneApi=true --interactive=true --routing=true --e2eTestRunner=playwright --nxCloudToken=66ff7c5b6e46622bb2fb2b37

 NX  Generating @nx/workspace:preset

Fetching prettier...
Fetching @nx/webpack...

 NX   Unable to read the target configuration for the provided build target, mobile:build

Are you sure this target exists?
Pass --verbose to see the stacktrace.

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

 NX   Workspace creation failed, see above.

Pass --verbose to see the stacktrace.

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

warning @nx/react-native > [email protected]: Glob versions prior to v9 are no longer supported
warning @nx/react-native > glob > [email protected]: 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.
warning @nx/react-native > @nx/jest > @jest/reporters > [email protected]: Glob versions prior to v9 are no longer supported
warning @nx/react-native > @nx/jest > @jest/reporters > glob > [email protected]: 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.
warning @nx/react-native > @nx/jest > jest-config > [email protected]: Glob versions prior to v9 are no longer supported
warning @nx/react-native > @nx/jest > jest-config > jest-runner > jest-runtime > [email protected]: Glob versions prior to v9 are no longer supported
warning @nx/react-native > @nx/jest > @jest/reporters > @jest/transform > babel-plugin-istanbul > test-exclude > [email protected]: Glob versions prior to v9 are no longer supported
warning "@nx/react-native > @nx/js > [email protected]" has unmet peer dependency "@types/node@*".
warning "@nx/react-native > @nx/js > [email protected]" has unmet peer dependency "typescript@>=2.7".
warning "@nx/react-native > @nx/jest > @phenomnomnominal/[email protected]" has unmet peer dependency "typescript@^3 || ^4 || ^5".
warning "@nx/react-native > @nx/react > [email protected]" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
warning "@nx/react-native > @nx/[email protected]" has unmet peer dependency "eslint@^8.0.0 || ^9.0.0".
warning "@nx/react-native > @nx/react > @module-federation/enhanced > @module-federation/[email protected]" has unmet peer dependency "typescript@^4.9.0 || ^5.0.0".
warning "@nx/react-native > @nx/react > @module-federation/enhanced > @module-federation/[email protected]" has unmet peer dependency "react@>=16.9.0".
warning "@nx/react-native > @nx/react > @module-federation/enhanced > @module-federation/[email protected]" has unmet peer dependency "react-dom@>=16.9.0".
error Command failed with exit code 1.
error Command failed with exit code 1.

@wangyinyuan
Copy link

Stuck in the step of creating workspace, also. Any idea?

Description

When attempting to initialize a new Nx workspace using the command npx create-nx-workspace@latest --preset=next, I encountered an error: "Maximum number of redirects exceeded".

Steps to Reproduce

  1. Run the command: npx create-nx-workspace@latest --preset=next
  2. Follow the prompts to configure the workspace:
    • Workspace name: org
    • Application name: org
    • Use App Router: Yes
    • Use src/ directory: Yes
    • E2E test runner: playwright
    • Default stylesheet format: css
    • CI provider: github
  3. Dependencies installation completes successfully
  4. Workspace creation fails with an error

Error Message


 NX   Maximum number of redirects exceeded

Error [ERR_FR_TOO_MANY_REDIRECTS]: Maximum number of redirects exceeded
    at AxiosError.from (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/axios/dist/node/axios.cjs:876:14)
    at RedirectableRequest.handleRequestError (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/axios/dist/node/axios.cjs:3156:25)
    at RedirectableRequest.emit (node:events:519:28)
    at RedirectableRequest._onNativeResponse (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/follow-redirects/index.js:105:12)
    at Object.onceWrapper (node:events:634:26)
    at ClientRequest.emit (node:events:519:28)
    at HTTPParser.parserOnIncomingClient (node:_http_client:698:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
    at Socket.socketOnData (node:_http_client:540:22)
    at Socket.emit (node:events:519:28)
    at Axios.request (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/axios/dist/node/axios.cjs:4287:41)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async createNxCloudWorkspaceV2 (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/nx/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js:47:22)
    at async connectToNxCloud (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/nx/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js:101:44)
    at async generateWorkspaceFiles (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/@nx/workspace/src/generators/new/generate-workspace-files.js:138:11)
    at async newGenerator (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/@nx/workspace/src/generators/new/new.js:13:28)
    at async /private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/nx/src/command-line/new/new.js:23:22
    at async handleErrors (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/nx/src/utils/handle-errors.js:9:24)
    at async Object.handler (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/nx/src/command-line/new/command-object.js:10:22)
Caused by:
Error [ERR_FR_TOO_MANY_REDIRECTS]: Maximum number of redirects exceeded
    at RedirectableRequest._processResponse (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/follow-redirects/index.js:424:11)
    at RedirectableRequest._onNativeResponse (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/follow-redirects/index.js:102:12)
    at Object.onceWrapper (node:events:634:26)
    at ClientRequest.emit (node:events:519:28)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:698:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
    at Socket.socketOnData (node:_http_client:540:22)
    at Socket.emit (node:events:519:28)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)

Environment

  • OS: macOS 14.6.1 (23G93)
  • Node.js version: v20.14.0
  • npm version: 10.7.0
  • create-nx-workspace version: v19.8.3

Attempted Solutions

  1. Changed network environments, but the issue persists
  2. Confirmed network connection is working, as npm dependencies were installed successfully

Expected Behavior

Successfully create an Nx workspace without encountering redirect errors.

Actual Behavior

Workspace creation fails with a "Maximum number of redirects exceeded" error.

@nvinay-litmus7
Copy link

@wangyinyuan Have you tried creating without the E2E test runners? Try skipping that E2E test suite and see if it is working.

Stuck in the step of creating workspace, also. Any idea?

Description

When attempting to initialize a new Nx workspace using the command npx create-nx-workspace@latest --preset=next, I encountered an error: "Maximum number of redirects exceeded".

Steps to Reproduce

  1. Run the command: npx create-nx-workspace@latest --preset=next

  2. Follow the prompts to configure the workspace:

    • Workspace name: org
    • Application name: org
    • Use App Router: Yes
    • Use src/ directory: Yes
    • E2E test runner: playwright
    • Default stylesheet format: css
    • CI provider: github
  3. Dependencies installation completes successfully

  4. Workspace creation fails with an error

Error Message


 NX   Maximum number of redirects exceeded

Error [ERR_FR_TOO_MANY_REDIRECTS]: Maximum number of redirects exceeded
    at AxiosError.from (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/axios/dist/node/axios.cjs:876:14)
    at RedirectableRequest.handleRequestError (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/axios/dist/node/axios.cjs:3156:25)
    at RedirectableRequest.emit (node:events:519:28)
    at RedirectableRequest._onNativeResponse (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/follow-redirects/index.js:105:12)
    at Object.onceWrapper (node:events:634:26)
    at ClientRequest.emit (node:events:519:28)
    at HTTPParser.parserOnIncomingClient (node:_http_client:698:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
    at Socket.socketOnData (node:_http_client:540:22)
    at Socket.emit (node:events:519:28)
    at Axios.request (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/axios/dist/node/axios.cjs:4287:41)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async createNxCloudWorkspaceV2 (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/nx/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js:47:22)
    at async connectToNxCloud (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/nx/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js:101:44)
    at async generateWorkspaceFiles (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/@nx/workspace/src/generators/new/generate-workspace-files.js:138:11)
    at async newGenerator (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/@nx/workspace/src/generators/new/new.js:13:28)
    at async /private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/nx/src/command-line/new/new.js:23:22
    at async handleErrors (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/nx/src/utils/handle-errors.js:9:24)
    at async Object.handler (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/nx/src/command-line/new/command-object.js:10:22)
Caused by:
Error [ERR_FR_TOO_MANY_REDIRECTS]: Maximum number of redirects exceeded
    at RedirectableRequest._processResponse (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/follow-redirects/index.js:424:11)
    at RedirectableRequest._onNativeResponse (/private/var/folders/1b/j8x5wzbn54xbjcnzpz_vswbw0000gn/T/tmp-22774-JjC1Km0q69F7/node_modules/follow-redirects/index.js:102:12)
    at Object.onceWrapper (node:events:634:26)
    at ClientRequest.emit (node:events:519:28)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:698:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
    at Socket.socketOnData (node:_http_client:540:22)
    at Socket.emit (node:events:519:28)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)

Environment

  • OS: macOS 14.6.1 (23G93)
  • Node.js version: v20.14.0
  • npm version: 10.7.0
  • create-nx-workspace version: v19.8.3

Attempted Solutions

  1. Changed network environments, but the issue persists
  2. Confirmed network connection is working, as npm dependencies were installed successfully

Expected Behavior

Successfully create an Nx workspace without encountering redirect errors.

Actual Behavior

Workspace creation fails with a "Maximum number of redirects exceeded" error.

@wangyinyuan
Copy link

@nvinay-litmus7 Quite sad. I tried setting E2E to none and keeping the rest same as before, but still get the same error.


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

✔ Where would you like to create your workspace? · org
✔ Application name · org
✔ Would you like to use the App Router (recommended)? · Yes
✔ Would you like to use the src/ directory? · Yes
✔ Test runner to use for end to end (E2E) tests · none
✔ Default stylesheet format · tailwind
✔ Which CI provider would you like to use? · github

 NX   Creating your v19.8.3 workspace.

✔ Installing dependencies with npm
✖ Creating your workspace in org

 NX   Failed to create a workspace.

@nvinay-litmus7
Copy link

@wangyinyuan I just tried creating a new workspace. Sending you the steps below which actually worked for me. I'm using an M-series mac. Also using yarn as the package manager to create this, because npm is always throwing me an error while creating. But whenever I select an E2E option this approach will fail but if I skip and chose none it is working fine.

Steps:

npx create-nx-workspace --pm yarn

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

✔ Where would you like to create your workspace? · Org1
✔ Which stack do you want to use? · react
✔ What framework would you like to use? · react-native
✔ Application name · mobile
✔ Test runner to use for end to end (E2E) tests · none
✔ Which CI provider would you like to use? · github

 NX   Creating your v19.8.3 workspace.

✔ Installing dependencies with yarn
✔ Successfully created the workspace: Org1.
✔ Nx Cloud has been set up successfully
✔ CI workflow has been generated successfully

 NX   Directory is already under version control. Skipping initialization of git.

@wangyinyuan
Copy link

@nvinay-litmus7 Thanks for the reminder, I didn't specify a pm and used npm by default, but after I specified yarn as the pm and disabled E2E, it still didn't work, so I tried skipping the CI again and it finally worked. Here is my successful case:

╰─$ npx create-nx-workspace --pm yarn --preset=next --verbose                                                          1 ↵

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

✔ Where would you like to create your workspace? · blog
✔ Application name · blog
✔ Would you like to use the App Router (recommended)? · Yes
✔ Would you like to use the src/ directory? · Yes
✔ Test runner to use for end to end (E2E) tests · none
✔ Default stylesheet format · tailwind
✔ Which CI provider would you like to use? · skip
✔ Would you like remote caching to make your build faster? · skip

 NX   Creating your v19.8.3 workspace.

✔ Installing dependencies with yarn
✔ Successfully created the workspace: blog.

 NX   Directory is already under version control. Skipping initialization of git.

@wangyinyuan I just tried creating a new workspace. Sending you the steps below which actually worked for me. I'm using an M-series mac. Also using yarn as the package manager to create this, because npm is always throwing me an error while creating. But whenever I select an E2E option this approach will fail but if I skip and chose none it is working fine.

Steps:

npx create-nx-workspace --pm yarn

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

✔ Where would you like to create your workspace? · Org1
✔ Which stack do you want to use? · react
✔ What framework would you like to use? · react-native
✔ Application name · mobile
✔ Test runner to use for end to end (E2E) tests · none
✔ Which CI provider would you like to use? · github

 NX   Creating your v19.8.3 workspace.

✔ Installing dependencies with yarn
✔ Successfully created the workspace: Org1.
✔ Nx Cloud has been set up successfully
✔ CI workflow has been generated successfully

 NX   Directory is already under version control. Skipping initialization of git.

@ndcunningham ndcunningham self-assigned this Oct 6, 2024
@ndcunningham
Copy link
Contributor

I took a look if I could reproduce, and using yarn as the package manager does create this issue.

A workaround at the moment is to use another package manager if possible, while I investigate this issue.

@nvinay-litmus7
Copy link

@ndcunningham With npm also if we are opting for E2E it is getting failed. Please find the details below:

npx create-nx-workspace --pm npm
Need to install the following packages:
[email protected]
Ok to proceed? (y) y


 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? · react
✔ What framework would you like to use? · react-native
✔ Application name · mobile
✔ Test runner to use for end to end (E2E) tests · playwright
✔ Which CI provider would you like to use? · github

 NX   Creating your v20.0.0 workspace.

✔ Installing dependencies with npm
✖ Creating your workspace in org

 NX   Failed to create a workspace.

Error: npm warn deprecated [email protected]: 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 [email protected]: Glob versions prior to v9 are no longer supported

Copy link

github-actions bot commented Jan 3, 2025

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 3, 2025
isaacplmann pushed a commit that referenced this issue Feb 11, 2025
## Current Behavior
On Windows, when packageManager=pnpm, `create-nx-workspace` fails due to
an issue with `child_process.spawn`.
Using `spawn`, the `@nx/workspace:preset` generator is executed twice
when `packageManager=pnpm`, causing the overall create-nx-workspace flow
to fail, even though most things have been set up correctly to that
point.

Using `fork` has shown success.

## Expected Behavior
Running `create-nx-workspace --packageManager=pnpm` should work on
Windows

## Fixes
Fixes #20222 
Fixes #27270 
Fixes #22917 
Fixes #22312 
Fixes #28710 
Fixes #28289 
Fixes #28235 
Fixes #22383 
Fixes #21742 
Fixes #20270
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants