简体   繁体   中英

Why ng g c Command not working in nativeScript + Angular project

when i run "ng g c welcome" to generate a new component i get error: Error: This command is not available when running the Angular CLI outside a workspace.

i tried running commands:

  • tns extension install nativescript-angular-cli
  • npm i -g @angular/cli
  • npm i -g @nativescript/schematics
  • npm i --save-dev @nativescript/schematics
  • npm install -D @angular/cli
  • npm i @angular-devkit/schematics @angular-devkit/core @schematics/angular

Please read: https://stackoverflow.com/a/74996251/5276893

In sum. The schematics are no longer supported. You can use component generators through nx, though, which don't rely on angular specifics, or through https://www.npmjs.com/package/@nstudio/angular

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM