简体   繁体   English

ionic 4 在 app.module.ts 页面中出现错误,从 '@angular/core' 导入 { NgModule };

[英]ionic 4 getting an error in app.module.ts page, import { NgModule } from '@angular/core';

在此处输入图像描述 when i hoover on error am getting Parsing error: Cannot read file < 'e:\simmongrim\spotify\tsconfig.json'.eslint.当我遇到错误时出现解析错误:无法读取文件 < 'e:\simmongrim\spotify\tsconfig.json'.eslint。 > colud anyone please help me. > colud任何人请帮助我。 have been struck with this error for more than a week did not get any solution.被这个错误打击了一个多星期没有得到任何解决方案。 please please anyone help me.请任何人帮助我。 thanks in advance..提前致谢..

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouteReuseStrategy } from '@angular/router';
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
@NgModule({
  declarations: [AppComponent],
  entryComponents: [],
  imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
  providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
  bootstrap: [AppComponent],
})
export class AppModule {}

If you are trying to use reactive forms, then it might be that you are missing ReactFormsModule in your imports.如果您尝试使用反应式 forms,则可能是您的导入中缺少 ReactFormsModule。

Does the tsconfig.json file exist at the root of your app ( e:\simmongrim\spotify\tsconfig.json )? tsconfig.json文件是否存在于您的应用程序的根目录中( e:\simmongrim\spotify\tsconfig.json )? If not, you will want to add that file.如果没有,您将需要添加该文件。 Angular has a TypeScript configuration page that may also help you with properties to add to that file. Angular有一个 TypeScript 配置页面,它还可以帮助您将属性添加到该文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM