我正在开发一个新的 NativeScript - Angular 项目,我尝试使用命令行来使用角度生成器(原理图)。我使用的命令
tns generate component <component name>
结果是我,
Error: Unable to locate a workspace file for workspace path.
at Object.readWorkspace (C:\Users\REDTECH\Desktop\NativeScript\attendence-manager-mobile\node_modules\@angular-devkit\core\src\workspace\core.js:75:19)
at async Object.getWorkspace (C:\Users\REDTECH\Desktop\NativeScript\attendence-manager-mobile\node_modules\@schematics\angular\utility\workspace.js:53:27)
我也尝试过使用
ng g c <component name>
结果是我
The generate command requires to be run in an Angular project, but a project definition could not be found.
我尝试重新安装 Angular cli、nativescript cli 和 @nativescript/schematics,但它没有解决问题。
ng 用于 Angular,ns 用于 NativeScript,尝试 ns g c 甚至更好,ns 生成组件