NativeScript:无法找到工作区路径的工作区文件

问题描述 投票:0回答:1

我正在开发一个新的 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,但它没有解决问题。

angular nativescript angular-cli
1个回答
0
投票

ng 用于 Angular,ns 用于 NativeScript,尝试 ns g c 甚至更好,ns 生成组件

© www.soinside.com 2019 - 2024. All rights reserved.