I\'m brand new to Angular 2 and attempting to follow along with a video tutorial I found. Despite following all of the steps, Angular just won\'t work; I get the following e
I had the same problem but none of all those solutions worked for me. After further investigation, I found out that an undesired import was in one of my component.
I use setTimeout
function in app.component but for any reason Visual Studio added import { setTimeout } from 'timer';
where it was not needed. Removing this line fixed the issue.
So remember to check your imports before going further. Hope it may help someone.
The issue is fixed only when re installed angular/cli manually. Follow following steps. (run all command under Angular project dir)
1)Remove webpack by using following command.
npm remove webpack
2)Install cli by using following command.
npm install --save-dev @angular/cli@latest
after successfully test app, it will work :)
if not then follow below steps.
1) Delete node_module folder.
2) Clear cache by using following command.
npm cache clean --force
3) Install node packages by using following command.
npm install
4)Install angular@cli by using following command.
npm install --save-dev @angular/cli@latest
Note :if failed,try again :)
5) Celebrate :)
I would recommend restarting the application. Most of the cases editor won't be able to detect the changes in the lazy loaded module.
I had this issue when i cloned from a git repository and I had it resolved when I created a new project and re-inserted the src folder from the old project.
The src folder is the only folder needed when deploying your angular application but you must reconfigure the dev environment, using this solution.
you need to enable the ngModel directive. This is done by adding the FormsModule to the imports[] array in the AppModule.
You then also need to add the import from @angular/forms in the app.module.ts file: import { FormsModule } from '@angular/forms';
In my case, I was trying to upgrade my angular 6 project using ng update
after that the entire universe collapse.
I was trying to update my project using this commands:
And then I found a problem with rxjs package and I run also this command. - npm install --save rxjs
And then I get the error
No NgModule metadata found
I solve this by deleting my node_modules folder in the project root and then I run:
That's is, all works nice.