Even though I tried following the suggestions provided in this Stack Overflow thread, I am still encountering the error "TypeScript error in Angular2 code: Cannot find name 'module'". My development environment consists of Angular 5 and npm version 6.9.0. Currently, I am working on a tutorial that can be found here - .
In my ./src/app/app.component.ts file, I have the following code snippet at the top:
import { Component,trigger,animate,style,transition,keyframes } from '@angular/core';
import { FormsModule } from '@angular/forms';
@NgModule({
imports: [
BrowserModule,
FormsModule //<----------make sure you have added this.
],
})
Upon running the application, I encounter the following error message:
localhost:todo-app davea$ ng serve
** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
Date: 2019-05-17T17:06:29.377Z
Hash: e9b5158cd1cb6d5685c7
Time: 2561ms
chunk {inline} inline.bundle.js (inline) 3.85 kB [entry] [rendered]
chunk {main} main.bundle.js (main) 2.91 kB [initial] [rendered]
chunk {polyfills} polyfills.bundle.js (polyfills) 577 bytes [initial] [rendered]
chunk {styles} styles.bundle.js (styles) 41.6 kB [initial] [rendered]
chunk {vendor} vendor.bundle.js (vendor) 867 kB [initial] [rendered]
ERROR in src/app/app.component.ts(4,2): error TS2552: Cannot find name 'NgModule'. Did you mean 'module'?
src/app/app.component.ts(6,14): error TS2304: Cannot find name 'BrowserModule'.
I'm currently stuck on resolving the issue with NgModule recognition. Any guidance on how to proceed would be greatly appreciated.