How can I resolve a Duplicate identifier 'by' error?

How can I resolve a Duplicate identifier 'by' error?

I was doing some test using the DomSanitizer class. I undo all my changes using git checkout -- . and I got this console error:

I was doing some test using the DomSanitizer class. I undo all my changes using git checkout -- . and I got this console error:

I checkout into another git branch and the error is still there.

This are my specs

Angular CLI: 6.2.8
Node: 8.12.0
OS: win32 x64
Angular: 6.1.10
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.8.8 @angular-devkit/build-angular 0.8.8 @angular-devkit/build-optimizer 0.8.8 @angular-devkit/build-webpack 0.8.8 @angular-devkit/core 0.8.8 @angular-devkit/schematics 0.8.8 @angular/cli 6.2.8 @ngtools/webpack 6.2.8 @schematics/angular 0.8.8 @schematics/update 0.8.8 rxjs 6.2.2 typescript 2.9.2 webpack 4.16.4

This is the error

ERROR in node_modules/@angular/core/src/sanitization/security.d.ts(32,3): error TS2300: Duplicate identifier 'by'.
node_modules/@angular/platform-browser/src/security/dom_sanitization_service.d.ts(83,31): error TS2720: Class 'DomSanitizer' incorrectly implements class 'Sanitizer'. Did you mean to extend 'Sanitizer' and inherit its members as a subclass?
  Property 'by' is missing in type 'DomSanitizer'.

I don't use DomSanitizer anywhere in my project, so I don't understand why I get this error when I run ng serve

This is what node_modules/@angular/platform-browser/src/security/dom_sanitization_service.d.tscontains:

export declare abstract class DomSanitizer implements Sanitizer {

My text editor was complaining about implements and I changed to extends.

I got a new error message:

ERROR in node_modules/@angular/core/src/sanitization/security.d.ts(32,3): error TS2300: Duplicate identifier 'by'.

This is the content of node_modules/@angular/core/src/sanitization/security.d.ts

export declare abstract class Sanitizer {
  by: any;
  by: any;
    abstract sanitize(context: SecurityContext, value: {} | string | null): string | null;
}

It contains the by: any property twice, so I deleted one and it worked like a charm.

Can someone explain me why this happended? I don't understand why the content of a node_modules file could sudenly change.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Angular 8 Node & Express JS File Upload

In this Angular 8 and Node.js tutorial, we are going to look at how to upload files on the Node server. To create Angular image upload component, we will be using Angular 8 front-end framework along with ng2-file-upload NPM package; It’s an easy to use Angular directives for uploading the files.

How to Implement Server Side Pagination with Angular 8 and Node.js

A simple example of how to implement server-side pagination in Angular 8 with a Node.js backend API.

Difference between Node.js and React.js and Angular.js

AngularJS turned the whole definition of web development through its existence, what was lacking in previous methods of development was inappropriate structure. It merges use of JavaScript with MVC and HTML with DOM. ReactJS is a JavaScript library and has a view, but lacks model & controller components. React introduced the concept of virtual DOM which is regarded as one of the greatest advantages of React in comparison of AngularJS. Node.js is a JavaScript-based platform used for developing real-time network applications like a chat software.