Skip to content

ng generate service: Project "undefined" does not exist. #22332

@greenpau

Description

@greenpau

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

No.

Description

Failed generating Angular service.

I am working on creating a standalone service (later will publish to npm). My thinking is I need to generate a workspace and after that, I generate a service. Perhaps, I am missing a step.

🔬 Minimal Reproduction

First, cloned empty project and tested the generation of new Angular workspace.

mkdir ngx-authp-service
cd ngx-authp-service
ng new ngx-authp-service --create-application=false --commit=false --routing=false --style=scss --directory=./ --dry-run

The dry run has the following output:

CREATE README.md (1061 bytes)
CREATE .editorconfig (274 bytes)
CREATE .gitignore (620 bytes)
CREATE angular.json (139 bytes)
CREATE package.json (1033 bytes)
CREATE tsconfig.json (863 bytes)
CREATE .vscode/extensions.json (130 bytes)
CREATE .vscode/launch.json (474 bytes)
CREATE .vscode/tasks.json (938 bytes)

Next, created the workspace:

ng new ngx-authp-service --create-application=false --commit=false --routing=false --style=scss --directory=./ --skip-install=true

The state of the repo prior to trying to generate the service: greenpau/ngx-authp-service@911cd3a

After that, attempted to create ngx-authp-service service:

ng generate service ngx-authp-service

🔥 Exception or Error


$ ng generate service ngx-authp-service
Project "undefined" does not exist.

🌍 Your Environment


Angular CLI: 13.1.0
Node: 14.17.6
Package Manager: npm 8.1.2
OS: linux x64

Angular: 
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1301.0 (cli-only)
@angular-devkit/core         13.1.0 (cli-only)
@angular-devkit/schematics   13.1.0 (cli-only)
@angular/cli                 13.1.0 (cli-only)
@schematics/angular          13.1.0 (cli-only)
rxjs                         6.6.7 (cli-only)
typescript                   4.4.3 (cli-only)

Anything else relevant?

No.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions