raneshu
raneshu

Reputation: 413

@angular/core/index has no exported member 'Renderer2'

@angular/core version 4.1.3 (@angular/common, @angular/forms, etc also have versions 4.1.3)

@ng-bootstrap/ng-bootstrap version 1.0.0-alpha.26

typescript version 2.3.3

Getting Module @angular/core/index has no exported member 'Renderer2' error in the following files after building:

/node_modules/@ng-bootstrap/ng-bootstrap/buttons/radio.d.ts

/node_modules/@ng-bootstrap/ng-bootstrap/datepicker/datepicker-input.d.ts

/node_modules/@ng-bootstrap/ng-bootstrap/modal/modal-window.d.ts:

/node_modules/@ng-bootstrap/ng-bootstrap/popover/popover.d.ts

Upvotes: 1

Views: 13013

Answers (1)

Carlos Antillon
Carlos Antillon

Reputation: 31

The error is because when you run npm install, the same libraries as the project you are running are not installed. In order to solve it:

  1. Run the npm list command on the console located in the project folder.
  2. Locate the bootstrap version you have installed.
  3. Modify the package.json file with the specific version. (Remove ^).
  4. Run "npm install" again.
  5. Run the "ng serve" command.

Example: I had to change:

"@ Ng-bootstrap / ng-bootstrap": "^ 1.0.0-alpha.21".

By

"@ Ng-bootstrap / ng-bootstrap": "1.0.0-alpha.22".

In package.json file.

Upvotes: 2

Related Questions