【问题标题】:ionic serve has Typescript Error at "node_modules/@angular/core/src/render3/definition.d.ts"离子服务在“node_modules/@angular/core/src/render3/definition.d.ts”处有打字稿错误
【发布时间】:2019-08-13 10:55:24
【问题描述】:

我在我的 Windows 中安装了 ionic 4,我的应用程序运行良好,但是当我将其降级到 ionic 3 时,它一直给我错误。所以我完全卸载了cordova、ionic和nodejs,并删除了节点缓存并重新安装了所有东西,但是当我运行ionic serve时,它一直在浏览器中为我以前拥有的每个应用程序提供这个错误:

Typescript Error
'=' expected.
.../app/node_modules/@angular/core/src/di/injector.d.ts
constructor(providers: StaticProvider[], parent?: Injector, source?: string | null);
get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): T;
get(token: any, notFoundValue?: any): any;
Typescript Error
')' expected.
...e /app/node_modules/@angular/core/src/render3/definition.d.ts
* Static attributes to set on host element.
*
* Even indices: attribute name
Typescript Error
Identifier expected.
.../app/node_modules/@angular/core/src/render3/definition.d.ts
* Static attributes to set on host element.
*
* Even indices: attribute name
Typescript Error
';' expected.
...app/node_modules/@angular/core/src/render3/definition.d.ts
* Static attributes to set on host element.
*
* Even indices: attribute name
Typescript Error
Property or signature expected.
...app/node_modules/@angular/core/src/render3/definition.d.ts
* Static attributes to set on host element.
*
* Even indices: attribute name
Typescript Error
'=>' expected.
.../app/node_modules/@angular/core/src/render3/definition.d.ts
* Static attributes to set on host element.
*
* Even indices: attribute name
Typescript Error
Expression expected.
...app/node_modules/@angular/core/src/render3/definition.d.ts
* Given:
* ```
* class MyComponent {
Typescript Error
Expression expected.
.../app/node_modules/@angular/core/src/render3/definition.d.ts
* Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.
*
* This allows the render to re-construct the minified and non-minified names
Typescript Error
']' expected.
...app/node_modules/@angular/core/src/render3/definition.d.ts
* Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.
*
* This allows the render to re-construct the minified and non-minified names
Typescript Error
',' expected.
.../app/node_modules/@angular/core/src/render3/definition.d.ts
* Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.
*
* This allows the render to re-construct the minified and non-minified names
Typescript Error
Property assignment expected.
...app/node_modules/@angular/core/src/render3/definition.d.ts
* Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.
*
* This allows the render to re-construct the minified and non-minified names
Typescript Error
Property assignment expected.
...app/node_modules/@angular/core/src/render3/definition.d.ts
* Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.
*
* This allows the render to re-construct the minified and non-minified names
Typescript Error
':' expected.
...app/node_modules/@angular/core/src/render3/definition.d.ts
* Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.
*
* This allows the render to re-construct the minified and non-minified names
.
.
.

我还尝试删除 node_modules 并为我的应用重新安装所有这些,但没有奏效。

我有:

Ionic Framework: 3.9.2
Ionic App Scripts: 3.2.2
Angular Core: ^7.2.9
Angular Compiler CLI: ^7.2.9
Node: 11.12.0
OS Platform: Windows 7
Navigator Platform: Win32
User Agent: Mozilla/5.0 

【问题讨论】:

    标签: node.js angular typescript ionic-framework ionic3


    【解决方案1】:

    好吧,你看没有人回答!我必须构建一个新应用程序并重新开始工作!即使将代码复制到新应用程序也不起作用!!! 问题之一是我的节点版本。我提到它以防有人遇到同样的问题并想尝试解决它。​​

    【讨论】:

      猜你喜欢
      • 2019-01-12
      • 2019-01-24
      • 1970-01-01
      • 2018-07-25
      • 2019-02-02
      • 2017-09-27
      • 2020-03-11
      • 2018-01-03
      • 1970-01-01
      相关资源
      最近更新 更多