首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >尝试命令ng serve时出错TS 2694

尝试命令ng serve时出错TS 2694
EN

Stack Overflow用户
提问于 2022-03-11 15:43:50
回答 1查看 289关注 0票数 1

当我试图运行我的角度应用程序时,我有这些严重的错误,老实说,我不知道出了什么问题,也许有人可以帮助我。我没有做什么特别的事情,我只是添加了一个组件,然后程序就不工作了。我试图删除node_modules文件夹,但它没有帮助我,也尝试了npm安装,但没有任何好处。

代码语言:javascript
复制
Error: ../../../../../../node_modules/@angular/core/src/application_init.d.ts:29:25 - error TS2694: Namespace '"C:/Users/Matei/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.
29     static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<ApplicationInitStatus, [{ optional: true; }]>;
                           ~~~~~~~~~~~~~~~~~~~~
Error: ../../../../../../node_modules/@angular/core/src/application_init.d.ts:30:26 - error TS2694: Namespace '"C:/Users/Matei/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.
30     static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<ApplicationInitStatus>;
                            ~~~~~~~~~~~~~~~~~~~~~~~
Error: ../../../../../../node_modules/@angular/core/src/application_module.d.ts:32:25 - error TS2694: Namespace '"C:/Users/Matei/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.
32     static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<ApplicationModule, never>;
                           ~~~~~~~~~~~~~~~~~~~~
Error: ../../../../../../node_modules/@angular/core/src/application_module.d.ts:33:25 - error TS2694: Namespace '"C:/Users/Matei/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵNgModuleDeclaration'.
33     static ɵmod: ɵngcc0.ɵɵNgModuleDeclaration<ApplicationModule, never, never, never>;
                           ~~~~~~~~~~~~~~~~~~~~~
Error: ../../../../../../node_modules/@angular/core/src/application_module.d.ts:34:25 - error TS2694: Namespace '"C:/Users/Matei/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectorDeclaration'.
34     static ɵinj: ɵngcc0.ɵɵInjectorDeclaration<ApplicationModule>;
                           ~~~~~~~~~~~~~~~~~~~~~
Error: ../../../../../../node_modules/@angular/core/src/application_ref.d.ts:145:25 - error TS2694: Namespace '"C:/Users/Matei/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.
145     static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<PlatformRef, never>;
                            ~~~~~~~~~~~~~~~~~~~~
Error: ../../../../../../node_modules/@angular/core/src/application_ref.d.ts:146:26 - error TS2694: Namespace '"C:/Users/Matei/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.
146     static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<PlatformRef>;
                             ~~~~~~~~~~~~~~~~~~~~~~~
Error: ../../../../../../node_modules/@angular/core/src/application_ref.d.ts:312:25 - error TS2694: Namespace '"C:/Users/Matei/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.
312     static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<ApplicationRef, never>;
                            ~~~~~~~~~~~~~~~~~~~~
Error: ../../../../../../node_modules/@angular/core/src/application_ref.d.ts:313:26 - error TS2694: Namespace '"C:/Users/Matei/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.
313     static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<ApplicationRef>;
                             ~~~~~~~~~~~~~~~~~~~~~~~
Error: ../../../../../../node_modules/@angular/core/src/console.d.ts:12:25 - error TS2694: Namespace '"C:/Users/Matei/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.
12     static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<Console, never>;
                           ~~~~~~~~~~~~~~~~~~~~
Error: ../../../../../../node_modules/@angular/core/src/console.d.ts:13:26 - error TS2694: Namespace '"C:/Users/Matei/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.
13     static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<Console>;
                            ~~~~~~~~~~~~~~~~~~~~~~~
Error: ../../../../../../node_modules/@angular/core/src/linker/compiler.d.ts:71:25 - error TS2694: Namespace '"C:/Users/Matei/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.
71     static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<Compiler, never>;
                           ~~~~~~~~~~~~~~~~~~~~
Error: ../../../../../../node_modules/@angular/core/src/linker/compiler.d.ts:72:26 - error TS2694: Namespace '"C:/Users/Matei/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.
72     static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<Compiler>;
                            ~~~~~~~~~~~~~~~~~~~~~~~
Error: ../../../../../../node_modules/@angular/core/src/linker/system_js_ng_module_factory_loader.d.ts:39:25 - error TS2694: Namespace '"C:/Users/Matei/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.
39     static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<SystemJsNgModuleLoader, [null, { optional: true; }]>;
                           ~~~~~~~~~~~~~~~~~~~~
Error: ../../../../../../node_modules/@angular/core/src/linker/system_js_ng_module_factory_loader.d.ts:40:26 - error TS2694: Namespace '"C:/Users/Matei/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.
40     static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<SystemJsNgModuleLoader>;
                            ~~~~~~~~~~~~~~~~~~~~~~~
Error: ../../../../../../node_modules/@angular/core/src/testability/testability.d.ts:90:25 - error TS2694: Namespace '"C:/Users/Matei/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.
90     static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<Testability, never>;
                           ~~~~~~~~~~~~~~~~~~~~
Error: ../../../../../../node_modules/@angular/core/src/testability/testability.d.ts:91:26 - error TS2694: Namespace '"C:/Users/Matei/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.
91     static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<Testability>;
                            ~~~~~~~~~~~~~~~~~~~~~~~
Error: ../../../../../../node_modules/@angular/core/src/testability/testability.d.ts:134:25 - error TS2694: Namespace '"C:/Users/Matei/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.
134     static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<TestabilityRegistry, never>;
                            ~~~~~~~~~~~~~~~~~~~~
Error: ../../../../../../node_modules/@angular/core/src/testability/testability.d.ts:135:26 - error TS2694: Namespace '"C:/Users/Matei/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.
135     static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<TestabilityRegistry>;

以下是我运行ng版本时的版本:

代码语言:javascript
复制
Angular CLI: 13.2.6
Node: 16.13.1
Package Manager: npm 8.2.0
OS: win32 x64
Angular: 13.2.6
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1302.6
@angular-devkit/build-angular   13.2.6
@angular-devkit/core            13.2.6
@angular-devkit/schematics      13.2.6
@schematics/angular             13.2.6
rxjs                            6.6.7
typescript                      4.5.5

这是我的package.json文件

代码语言:javascript
复制
{
  "name": "client",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~13.2.6",
    "@angular/common": "~13.2.6",
    "@angular/compiler": "~13.2.6",
    "@angular/core": "~13.2.6",
    "@angular/forms": "~13.2.6",
    "@angular/platform-browser": "~13.2.6",
    "@angular/platform-browser-dynamic": "~13.2.6",
    "@angular/router": "~13.2.6",
    "bootstrap": "^4.5.3",
    "font-awesome": "^4.7.0",
    "ngx-bootstrap": "^7.1.2",
    "ngx-bootstrap-navbar": "^1.0.0",
    "rxjs": "~6.6.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^13.2.6",
    "@angular/cli": "~13.2.6",
    "@angular/compiler-cli": "~13.2.6",
    "@types/jasmine": "~3.8.0",
    "@types/node": "^12.11.1",
    "jasmine-core": "~3.8.0",
    "karma": "~6.3.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.0.3",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "~1.7.0",
    "typescript": "~4.5.5"
  }
}

如果您需要更多的信息或代码文件,请告诉我。非常感谢!!

EN

回答 1

Stack Overflow用户

发布于 2022-06-09 02:26:05

我在内存中的角-web@0.13.0中也有类似的问题,我尝试过的几个选项都在本文中:npm WARN ... requires a peer of ... but none is installed. You must install peer dependencies yourself

这个有一个类似的方法Could not resolve peer dependency between my Angular app and my custom Angular library

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71441067

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档