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

Error when trying to create an Angular service with Nx generator #19786

Closed
1 of 4 tasks
henriquecustodia opened this issue Oct 22, 2023 · 2 comments · Fixed by #19815
Closed
1 of 4 tasks

Error when trying to create an Angular service with Nx generator #19786

henriquecustodia opened this issue Oct 22, 2023 · 2 comments · Fixed by #19815
Assignees
Labels
outdated scope: angular Issues related to Angular support in Nx type: bug

Comments

@henriquecustodia
Copy link

henriquecustodia commented Oct 22, 2023

Current Behavior

When I execute the command

npx nx g @nx/angular:service my-service

I face the following error

Package "@nx/angular" was found but does not support schematics.

Expected Behavior

After execute the generator command, Nx should create two file for me (the Angular service and its spec).

GitHub Repo

https://github.com/henriquecustodia/nx-generator-bug

Steps to Reproduce

  1. npx create-nx-workspace@latest
  2. answer the cli questions
    ✔ Where would you like to create your workspace? · nx-generator-bug
    ✔ Which stack do you want to use? · angular
    ✔ Integrated monorepo, or standalone project? · standalone
    ✔ Default stylesheet format · css
    ✔ Test runner to use for end to end (E2E) tests · none
    ✔ Would you like to use Standalone Components in your application? · Yes
    ✔ Would you like to add routing? · No
    ✔ Enable distributed caching to make your CI faster · No

NX Creating your v17.0.1 workspace.

To make sure the command works reliably in all environments, and that the preset is applied correctly,
Nx will run "npm install" several times. Please wait.

✔ Installing dependencies with npm
✔ Successfully created the workspace: nx-generator-bug.
3. execute npx nx g @nx/angular:service my-service

Nx Report

>  NX   Report complete - copy this into the issue template

   Node   : 18.16.0
   OS     : linux-x64
   npm    : 9.5.1

   nx                 : 17.0.1
   @nx/js             : 17.0.1
   @nx/jest           : 17.0.1
   @nx/linter         : 17.0.1
   @nx/eslint         : 17.0.1
   @nx/workspace      : 17.0.1
   @nx/angular        : 17.0.1
   @nx/cypress        : 17.0.1
   @nx/devkit         : 17.0.1
   @nx/eslint-plugin  : 17.0.1
   @nrwl/tao          : 17.0.1
   @nx/web            : 17.0.1
   @nx/webpack        : 17.0.1
   typescript         : 5.1.6

Failure Logs

>  NX  Generating @nx/angular:service


 >  NX   Package "@nx/angular" was found but does not support schematics.


Error: Package "@nx/angular" was found but does not support schematics.
    at NodeModulesEngineHost.resolve (/home/dev/workspace/codedimension/youtube/nx-generator-bug/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.js:53:23)
    at NodeModulesEngineHost._resolveCollectionPath (/home/dev/workspace/codedimension/youtube/nx-generator-bug/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.js:80:37)
    at NodeModulesEngineHost.createCollectionDescription (/home/dev/workspace/codedimension/youtube/nx-generator-bug/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.js:118:27)
    at SchematicEngine._createCollectionDescription (/home/dev/workspace/codedimension/youtube/nx-generator-bug/node_modules/@angular-devkit/schematics/src/engine/engine.js:161:40)
    at SchematicEngine.createCollection (/home/dev/workspace/codedimension/youtube/nx-generator-bug/node_modules/@angular-devkit/schematics/src/engine/engine.js:154:43)
    at getCollection (/home/dev/workspace/codedimension/youtube/nx-generator-bug/node_modules/nx/src/adapter/ngcli-adapter.js:126:40)
    at Object.generate (/home/dev/workspace/codedimension/youtube/nx-generator-bug/node_modules/nx/src/adapter/ngcli-adapter.js:421:24)
    at /home/dev/workspace/codedimension/youtube/nx-generator-bug/node_modules/nx/src/command-line/generate/generate.js:259:97
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async handleErrors (/home/dev/workspace/codedimension/youtube/nx-generator-bug/node_modules/nx/src/utils/params.js:9:16)

Package Manager Version

9.5.1

Operating System

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

Additional Information

Windows 11

NodeJS: v18.16.0

@henriquecustodia henriquecustodia changed the title Error when trying to create a Angular service with Nx generator Error when trying to create an Angular service with Nx generator Oct 22, 2023
@mandarini mandarini added the scope: angular Issues related to Angular support in Nx label Oct 23, 2023
@riethmue
Copy link

Same here

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 Nov 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: angular Issues related to Angular support in Nx type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants