Angular-Cli clear cache

1

I am making changes to a project generated with angular-cli but it seems that I am hanging some file in 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 does not 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 clean the cache and recompile the project.

Thanks

    
asked by Ricardo D. Quiroga 11.04.2017 в 20:25
source

2 answers

2

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 return to user ng serve or npm start as you have decided to run it for the needs of it.

If you continue with problems, return npm install to update the folder of node_modules .

If you really need to clean the cache, use the following command: npm cache clean

    
answered by 11.04.2017 / 20:41
source
1

The problem shown here is a problem of angular-cli and not of NodeJs, I do not know if the code of the component was generated from the terminal or was written manually, if it was written manually, delete the folder and execute the command ng generate component (name of the component) which in this case would be pagescomponent.

    
answered by 04.04.2018 в 22:01