gpt4 book ai didi

Angular Nativescript 如何修复 ng g c 上的错误?

转载 作者:行者123 更新时间:2023-12-03 23:12:29 27 4
gpt4 key购买 nike

不久之前,我使用 angular - nativescript 创建了项目。我只使用了文档中的命令,安装后我试图运行这个命令:

ng generate component home 

我收到此错误:

An unhandled exception occurred: Cannot find module '@schematics/angular/utility/parse-name' See "C:\Users\andri\AppData\Local\Temp\ng-JFv0M5\angular-errors.log" for further details.



更多详细信息 :

[error] Error: Cannot find module '@schematics/angular/utility/parse-name' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15) at Function.Module._load (internal/modules/cjs/loader.js:508:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object. (C:\Users\andri\AppData\Roaming\npm\node_modules@nativescript\schematics\src\generate\component\index.js:6:22) at Module._compile (internal/modules/cjs/loader.js:701:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10) at Module.load (internal/modules/cjs/loader.js:600:32) at tryModuleLoad (internal/modules/cjs/loader.js:539:12) at 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

最佳答案

我在使用 Nativescript 的 ng g 遇到了类似的问题,所以也许它会帮助某人

可能的错误:

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

关于Angular Nativescript 如何修复 ng g c 上的错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57655363/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com