I am making changes in a project generated with angular-cli but it seems that some file is stuck in the cache and node does not realize it and keeps sending me an error message
ERROR in D:/Workspace/NodeJs/TrackEditor/src/app/pages/pages/pages.component.ts (6,5): Argument of type '{ selector: string; templateUrl: string; stylesUrl: string[]; }' is not assignable to parameter of type 'Component'.
Object literal may only specify known properties, and 'stylesUrl' does not exist in type 'Component'.
webpack: Failed to compile.
I corrected the pages.component.ts but it doesn't take the changes.
import { Component } from '@angular/core';
@Component({
selector: 'app-pages',
templateUrl: './pages.component.html',
styleUrls: ['./pages.css']
})
export class PagesComponent {}
some way to clear the cache and recompile the project.
Thank you
It has happened to me that the webpack does not recognize certain changes, so it is recommended that you cancel the execution of the project and go back to user
ng serve
ornpm start
depending on what you have decided to run it for its needs.If you continue to have problems, run again
npm install
to update the node_modules folder .If you really need to clear the cache, use the following command:
npm cache clean
The problem shown there is an angular-cli problem and not NodeJs, I don't know if the component code was generated from the terminal or was written manually, if it was written manually, delete the folder and run the ng generate component command (component name) which in this case would be pagescomponent.
Either you have wrong the information of the new component in the ' app.module.ts ' or some of the files that you have put under '@Component' (selector, templateUrl or styleUrls) do not exist.
The most normal is the first, the name of the class, the path where it is located or the name of the file are not correctly indicated in the 'app.module.ts'.