title: Angular 7 File '../src/types/@angular/common.d.ts' is not a module
body: <p>I've created a new Angular 7 project and in ap.routing.ts I have</p>
  
  <pre><code>import { CommonModule } from '@angular/common';
  import { NgModule } from '@angular/core';
  import { BrowserModule } from '@angular/platform-browser';
  import { RouterModule, Routes } from '@angular/router';
  import { ClientsComponent } from './components/clients/clients.component';
  import { HomeComponent } from './components/commons/home/home.component';
  import { FunctionalitiesComponent } from './components/functionalities/functionalities.component';
  import { ProcessesComponent } from './components/processes/processes.component';
  import { ProjectsComponent } from './components/projects/projects.component';
  import { UsersComponent } from './components/users/users.component';
  import { AuthenticationGuard } from './_guards/authentication.guard';
  import { LoginComponent } from './components/users/login/login.component';
  import { RegistrationComponent } from './components/users/registration/registration.component';
  
  
  
  const routes: Routes = [
    { path: '', redirectTo: 'home', pathMatch: 'full' },
    { path: 'home', component: HomeComponent, canActivate: [AuthenticationGuard] },
    { path: 'clients', component: ClientsComponent },
    { path: 'projects', component: ProjectsComponent },
    { path: 'functionalities', component: FunctionalitiesComponent },
    { path: 'processes', component: ProcessesComponent },
    { path: 'login', component: LoginComponent },
    { path: 'users', component: UsersComponent }
  
  ];
  
  @NgModule({
    imports: [
      CommonModule,
      BrowserModule,
      RouterModule.forRoot(routes, { enableTracing: true , onSameUrlNavigation: 'reload'})
    ],
    exports: [
    ],
  })
  export class AppRoutingModule { }
  </code></pre>
  
  <p>'@angular/common' is underlined in red and the following error is given:</p>
  
  <pre><code>File '{pathTo}/src/types/@angular/common.d.ts' is not a module
  </code></pre>
  
  <p>I have installed the module using</p>
  
  <pre><code>npm i @angular/common
  </code></pre>
  
  <p>restarted the visual editor (VS Code), re-run <code>ng serve</code> but nothing changed.<br>
  This is the package.json file:</p>
  
  <pre><code>{
    "name": "material-dashboard-angular",
    "version": "2.2.0",
    "license": "MIT",
    "scripts": {
      "ng": "ng",
      "start": "ng serve --base-href /admin/",
      "build": "ng build --aot --base-href /admin/",
      "build-prod": "ng build --prod --aot",
      "test": "ng test",
      "lint": "ng lint",
      "e2e": "ng e2e",
      "install:clean": "rm -rf node_modules/ &amp;&amp; rm -rf package-lock.json &amp;&amp; npm install &amp;&amp; ng serve -o"
    },
    "engines": {
      "node": "6.11.1",
      "npm": "3.10.9"
    },
    "private": true,
    "dependencies": {
      "@agm/core": "1.0.0-beta.5",
      "@angular/animations": "7.0.2",
      "@angular/cdk": "7.0.2",
      "@angular/common": "7.0.2",
      "@angular/compiler": "7.0.2",
      "@angular/core": "7.0.2",
      "@angular/forms": "7.0.2",
      "@angular/http": "7.0.2",
      "@angular/material": "7.0.2",
      "@angular/platform-browser": "7.0.2",
      "@angular/platform-browser-dynamic": "7.0.2",
      "@angular/platform-server": "7.0.2",
      "@angular/router": "7.0.2",
      "@auth0/angular-jwt": "^2.1.0",
      "@ngx-translate/core": "^11.0.1",
      "@ngx-translate/http-loader": "^4.0.0",
      "acorn": "^6.1.1",
      "ajv": "6.4.0",
      "angular-http-server": "^1.9.0",
      "angular-svg-icon": "^7.2.1",
      "arrive": "2.4.1",
      "bootstrap": "4.1.0",
      "bootstrap-material-design": "4.1.1",
      "bootstrap-notify": "3.1.3",
      "chartist": "0.11.0",
      "classlist.js": "1.1.20150312",
      "core-js": "2.4.1",
      "cron-validator": "^1.0.1",
      "express": "4.16.3",
      "file-input-accessor": "^7.0.0",
      "googleapis": "28.1.0",
      "hammerjs": "2.0.8",
      "jquery": "^3.4.1",
      "moment": "2.22.1",
      "perfect-scrollbar": "1.1.0",
      "popper.js": "1.14.3",
      "rxjs": "6.3.3",
      "rxjs-compat": "6.3.3",
      "sancronos-validator": "^1.2.0",
      "web-animations-js": "2.3.1",
      "zone.js": "0.8.26"
    },
    "devDependencies": {
      "@angular-devkit/build-angular": "^0.13.9",
      "@angular/cli": "6.0.3",
      "@angular/compiler-cli": "^7.2.15",
      "@angular/language-service": "7.0.2",
      "@types/bootstrap": "3.3.32",
      "@types/chartist": "0.9.34",
      "@types/googlemaps": "3.30.8",
      "@types/jasmine": "2.5.38",
      "@types/jquery": "1.10.31",
      "@types/node": "^6.0.73",
      "codelyzer": "4.2.1",
      "jasmine-core": "3.1.0",
      "jasmine-spec-reporter": "4.2.1",
      "karma": "^4.1.0",
      "karma-chrome-launcher": "2.2.0",
      "karma-cli": "1.0.1",
      "karma-coverage-istanbul-reporter": "1.4.2",
      "karma-jasmine": "1.1.1",
      "protractor": "^6.0.0",
      "ts-node": "5.0.1",
      "tslint": "5.9.1",
      "typescript": "3.1.6"
    }
  }
  </code></pre>
  
  <p><strong>ERROR LOG</strong></p>
  
  <blockquote>
    <p>ERROR in
    node_modules/@angular/cdk/overlay/typings/overlay-ref.d.ts(11,26):
    error TS2306: File
    'C:/Users/Marina/Desktop/heliosFrontEnd_admin/src/types/@angular/common.d.ts'
    is not a module.
    node_modules/@angular/cdk/overlay/typings/overlay.d.ts(9,26): error
    TS2306: File
    'C:/Users/Marina/Desktop/heliosFrontEnd_admin/src/types/@angular/common.d.ts'
    is not a module.
    node_modules/@angular/material/bottom-sheet/typings/bottom-sheet-ref.d.ts(8,26):
    error TS2306: File
    'C:/Users/Marina/Desktop/heliosFrontEnd_admin/src/types/@angular/common.d.ts'
    is not a module.
    node_modules/@angular/material/bottom-sheet/typings/bottom-sheet.d.ts(11,26):
    error TS2306: File
    'C:/Users/Marina/Desktop/heliosFrontEnd_admin/src/types/@angular/common.d.ts'
    is not a module.
    node_modules/@angular/material/dialog/typings/dialog-ref.d.ts(9,26):
    error TS2306: File
    'C:/Users/Marina/Desktop/heliosFrontEnd_admin/src/types/@angular/common.d.ts'
    is not a module.
    node_modules/@angular/material/dialog/typings/dialog.d.ts(10,26):
    error TS2306: File
    'C:/Users/Marina/Desktop/heliosFrontEnd_admin/src/types/@angular/common.d.ts'
    is not a module.
    node_modules/@angular/platform-browser/src/browser/location/browser_platform_location.d.ts(8,58):
    error TS2306: File
    'C:/Users/Marina/Desktop/heliosFrontEnd_admin/src/types/@angular/common.d.ts'
    is not a module.
    node_modules/@angular/router/src/directives/router_link.d.ts(8,34):
    error TS2306: File
    'C:/Users/Marina/Desktop/heliosFrontEnd_admin/src/types/@angular/common.d.ts'
    is not a module. node_modules/@angular/router/src/router.d.ts(8,26):
    error TS2306: File
    'C:/Users/Marina/Desktop/heliosFrontEnd_admin/src/types/@angular/common.d.ts'
    is not a module.
    node_modules/@angular/router/src/router_module.d.ts(8,106): error
    TS2306: File
    'C:/Users/Marina/Desktop/heliosFrontEnd_admin/src/types/@angular/common.d.ts'
    is not a module.
    node_modules/@angular/router/src/router_scroller.d.ts(8,34): error
    TS2306: File
    'C:/Users/Marina/Desktop/heliosFrontEnd_admin/src/types/@angular/common.d.ts'
    is not a module. src/app/app.routing.ts(1,30): error TS2306: File
    'C:/Users/Marina/Desktop/heliosFrontEnd_admin/src/types/@angular/common.d.ts'
    is not a module.</p>
  </blockquote>