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

npx create-nx-workspace@latest (v19.3.0) fails for a vue monorepo #26605

Closed
1 of 4 tasks
ghost23 opened this issue Jun 20, 2024 · 5 comments · Fixed by #26729
Closed
1 of 4 tasks

npx create-nx-workspace@latest (v19.3.0) fails for a vue monorepo #26605

ghost23 opened this issue Jun 20, 2024 · 5 comments · Fixed by #26729

Comments

@ghost23
Copy link

ghost23 commented Jun 20, 2024

Current Behavior

I am on a Windows 11 machine, running powershell.
I type npx create-nx-workspace@latest --verbose and answer the questions like this:

√ Where would you like to create your workspace? · demo
√ Which stack do you want to use? · vue
√ What framework would you like to use? · none
√ Integrated monorepo, or standalone project? · integrated
√ Application name · Sandbox
√ Test runner to use for end to end (E2E) tests · playwright
√ Default stylesheet format · scss
√ Do you want Nx Cloud to make your CI fast? · skip

Then it successfully installs the npm dependencies but fails at creating my workspace:

✔ Installing dependencies with npm
✖ Creating your workspace in nebf6-ui-monorepo

 NX   Failed to create a workspace.

Exit code: 1
Log file: C:\Users\<myuser>\AppData\Local\Temp\tmp-26616-xNwdu6g17RlE\error.log

In the log file it says:

added 404 packages, and audited 405 packages in 31s

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

found 0 vulnerabilities

 NX  Generating @nx/workspace:preset

Fetching prettier...

 NX   Cannot find configuration for 'Sandbox'

Pass --verbose to see the stacktrace.


 NX   Workspace creation failed, see above.


Error: Workspace creation failed, see above.
    at ChildProcess.<anonymous> (C:\Users\<myuser>\AppData\Local\Temp\tmp-26616-xNwdu6g17RlE\node_modules\@nx\workspace\src\generators\new\generate-preset.js:38:24)
    at ChildProcess.emit (node:events:519:28)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5)

Expected Behavior

My Vue Workspace should be correctly generated

GitHub Repo

No response

Steps to Reproduce

See description above

Nx Report

I do this in the unfinished project folder:

npx nx report

 NX   Report complete - copy this into the issue template

Node   : 20.14.0
OS     : win32-x64
npm    : 10.7.0

nx              : 19.3.0
@nx/js          : 19.3.0
@nx/linter      : 19.3.0
@nx/eslint      : 19.3.0
@nx/workspace   : 19.3.0
@nx/devkit      : 19.3.0
@nx/playwright  : 19.3.0
@nrwl/tao       : 19.3.0
@nx/vite        : 19.3.0
@nx/vue         : 19.3.0
@nx/web         : 19.3.0
typescript      : 5.4.5

Failure Logs

see in the description

Package Manager Version

npm v10.7.0

Operating System

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

Additional Information

No response

@ghost23
Copy link
Author

ghost23 commented Jun 20, 2024

Additonal info: I switched to node v21.7.3 and npm 10.5.0, same result.
Also node v22.3.0 and npm 10.8.1 fails in the same manner.

I also tried npx create-nx-workspace@19.2.3 with these answers with node v22.3.0:

√ Where would you like to create your workspace? · demo
√ Which stack do you want to use? · vue
√ What framework would you like to use? · none
√ Integrated monorepo, or standalone project? · integrated
√ Application name · Sandbox
√ Test runner to use for end to end (E2E) tests · playwright
√ Default stylesheet format · scss
√ Set up CI with caching, distribution and test deflaking · skip
√ Would you like remote caching to make your build faster? · skip

It also fails, same error.

@ghost23
Copy link
Author

ghost23 commented Jun 20, 2024

Ahh, now I tried using the same name for workspace and application name and then it works. But that is awkward?! Why ask for these two names in the first place if they have to be same anyway?

@Coly010
Copy link
Contributor

Coly010 commented Jun 27, 2024

Hey @ghost23 !

No there was an issue here.

The first name that the prompt asks for is the workspace name, useful for when you have multiple projects in the workspace. The second is the application name in particular that is set up immediately.

There was an issue with the second step here which didn't parse PascalCased names correctly.

@ghost23
Copy link
Author

ghost23 commented Jun 27, 2024

Ah, I see. Thank you for the explanation

Coly010 added a commit that referenced this issue Jun 27, 2024
…#26729)

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
The `vue` app generator is not using the normalized name produced by
`projectRootAndFormat` util when creating the application.
This leads to errors in some cases.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Use the `projectName` produced by the value to create the project
correctly.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #26605
Copy link

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 Jul 28, 2024
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants