angular - Angular Nativescript 如何修复 ng gc 上的错误?
问题描述
早些时候,我使用 angular - nativescript 创建了项目。我只使用了文档中的命令,安装后我试图运行这个命令:
ng generate component home
我收到此错误:
发生未处理的异常:找不到模块'@schematics/angular/utility/parse-name' 有关详细信息,请参阅“C:\Users\andri\AppData\Local\Temp\ng-JFv0M5\angular-errors.log”。
更多详细信息 :
[错误] 错误:在 Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15) 在 Function.Module._load (internal/ modules/cjs/loader.js:508:25) 在 Module.require (internal/modules/cjs/loader.js:637:17) 在 require (internal/modules/cjs/helpers.js:22:18) 在 Object . (C:\Users\andri\AppData\Roaming\npm\node_modules@nativescript\schematics\src\generate\component\index.js:6:22) 在 Module._compile (internal/modules/cjs/loader.js:701 :30) 在 Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10) 在 Module.load (internal/modules/cjs/loader.js:600:32) 在 tryModuleLoad (internal /modules/cjs/loader.js:539:12) 在 Function.Module._load (internal/modules/cjs/loader.js:531:3)
我该如何解决 ?
我的资料:
√ Component nativescript has 6.0.3 version and is up to date.
√ Component tns-core-modules has 6.0.7 version and is up to date.
√ Component tns-android has 6.0.2 version and is up to date.
√ Component tns-ios has 6.0.2 version and is up to date.
Angular CLI: 8.3.0
Node: 10.15.3
Angular: 8.2.3
@angular-devkit/architect 0.803.0 (cli-only)
@angular-devkit/core 8.2.2
@angular-devkit/schematics 8.3.0
@ngtools/webpack 8.2.2
@schematics/angular 8.3.0
@schematics/update 0.803.0 (cli-only)
rxjs 6.5.2
typescript 3.5.3
webpack 4.27.1
解决方案
ng g
我对Nativescript有类似的问题,所以也许它会对某人有所帮助
可能的错误:
An unhandled exception occurred: Could not find module "@nativescript/schematics" from
An unhandled exception occurred: Cannot find module '@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript'
An unhandled exception occurred: Cannot find module 'tslint'
对于tns --version
:6.3.3
缺少以下依赖项:@nativescript/schematics
@schematics/angular
tslint
要使其正常工作,请运行:
npm i -D @nativescript/schematics @schematics/angular tslint
推荐阅读
- kubernetes - 列出 Kubernetes 中运行的所有控制器
- c++ - 为什么让 operator new 私有中断 std::shared_ptr?
- rabbitmq - 聊天机器人中消息之间的动态延迟
- angular - Bootstrap Carousel 中的幻灯片不是以水平形式出现,而是仅以垂直形式出现
- xml - Powershell XML 删除 ChildNode“日期”超过一个月的节点
- python - 将数据框转换为列表时出现错误
- arrays - 两个excel数组的逻辑运算
- python - Python Web Scrape:删除输出中多余的 HTML 标签。所有数据都来自页表,get_text 和 pretiffy 不起作用
- r - 通过指数平滑获得预测的 RMSE
- node.js - 命令行工具的跨平台分发