离子服务在“ node_modules/@angular/core/src/render3/definition.d.ts”处有“打字稿错误”

时间:2019-03-22 12:42:05

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

我在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 

1 个答案:

答案 0 :(得分:0)

好吧,如您所见,没有人回答!我必须构建一个新的应用程序,然后才能重新开始工作!甚至将代码复制到新应用程序都行不通!!! 问题之一是我的节点版本。我提到它是为了防止有人遇到相同的问题并想解决它。