Issue with Keycloak Schematic in Angular18: Unknown Arguments Error

Discussão em 'Angular' iniciado por yessmine, Fevereiro 28, 2025.

  1. yessmine

    yessmine Guest

    I've been following the documentation to set up Keycloak in my Angular project. According to the documentation, I ran the following commands from the command line:

    ng new myApp
    cd myApp
    ng generate keycloak --collection @ssilvert/keycloak-schematic --clientId=myApp


    While executing these commands, everything worked fine until I reached the last one. Here’s the output from my terminal:

    PS C:\Users\LENOVO\Desktop\keycloak> npm install -g @ssilvert/keycloak-schematic

    added 10 packages in 11s

    1 package is looking for funding
    run `npm fund` for details
    PS C:\Users\LENOVO\Desktop\keycloak> ng new myApp
    ? Which stylesheet format would you like to use? CSS [ https://developer.mozilla.org/docs/Web/CSS ]
    ? Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)? No
    CREATE myApp/angular.json (2683 bytes)
    CREATE myApp/package.json (1075 bytes)
    CREATE myApp/README.md (1093 bytes)
    CREATE myApp/tsconfig.json (1054 bytes)
    CREATE myApp/.editorconfig (290 bytes)
    CREATE myApp/.gitignore (629 bytes)
    CREATE myApp/tsconfig.app.json (439 bytes)
    CREATE myApp/tsconfig.spec.json (449 bytes)
    CREATE myApp/.vscode/extensions.json (134 bytes)
    CREATE myApp/.vscode/launch.json (490 bytes)
    CREATE myApp/.vscode/tasks.json (980 bytes)
    CREATE myApp/src/main.ts (256 bytes)
    CREATE myApp/src/index.html (304 bytes)
    CREATE myApp/src/styles.css (81 bytes)
    CREATE myApp/src/app/app.component.html (20239 bytes)
    CREATE myApp/src/app/app.component.spec.ts (942 bytes)
    CREATE myApp/src/app/app.component.ts (314 bytes)
    CREATE myApp/src/app/app.component.css (0 bytes)
    CREATE myApp/src/app/app.config.ts (318 bytes)
    CREATE myApp/src/app/app.routes.ts (80 bytes)
    CREATE myApp/public/favicon.ico (15086 bytes)
    ✔ Packages installed successfully.
    Successfully initialized git.
    PS C:\Users\LENOVO\Desktop\keycloak> cd myApp
    PS C:\Users\LENOVO\Desktop\keycloak\myApp> ng generate keycloak --collection @ssilvert/keycloak-schematic --clientId=myApp
    Error: Unknown arguments: collection, clientId


    So as you see I receive an error when attempting to generate the Keycloak component using the command ng generate keycloak --collection @ssilvert/keycloak-schematic --clientId=myApp, stating "Unknown arguments: collection, clientId."

    Continue reading...

Compartilhe esta Página