robisim74 / angular-l10n

Angular library to translate texts, dates and numbers
MIT License
380 stars 59 forks source link

TS2305: Module '"/node_modules/@angular/core/index"' has no exported member 'Renderer2'. #65

Closed scheedalla closed 7 years ago

scheedalla commented 7 years ago

What version of Angular 2 does the new angular-l10n library support? I currently have 2.4.5 and get the following error when I include the library.

TS2305: Module '"/node_modules/@angular/core/index"' has no exported member 'Renderer2'.

robisim74 commented 7 years ago

See https://github.com/robisim74/angular-l10n/releases

scheedalla commented 7 years ago

very helpful - thanks!

rjdugar commented 7 years ago

I am also getting same error..

node_modules/@angular/core/index"' has no exported member 'Renderer2'. untitled

PFA screens hot with error and version of angular i am using .

Any help ?

robisim74 commented 7 years ago

Hey @rjdugar: you are in the wrong repository. You are getting your error from ng-sidebar. However the problem is the same: you have to use a version compatible with Angular v2, and not v4 (renderer2 is used in Angular v4). Regarding angular-l10n you have to use v2.0.9.

stephenad commented 7 years ago

HI @robisim,

I am getting the same errors "[default] ...\node_modules\@ng-bootstrap\ng-bootstrap\buttons\radio.d.ts:1:10 Module '".../node_modules/@angular/core/index"' has no exported member 'Renderer2'. [default] ...\node_modules\@ng-bootstrap\ng-bootstrap\datepicker\datepicker-input.d.ts:1:40 Module '".../node_modules/@angular/core/index"' has no exported member 'Renderer2'. [default] ..\node_modules\@ng-bootstrap\ng-bootstrap\modal\modal-window.d.ts:1:36 Module '".../node_modules/@angular/core/index"' has no exported member 'Renderer2'. [default] ...\node_modules\@ng-bootstrap\ng-bootstrap\popover\popover.d.ts:1:53 Module '"...i/node_modules/@angular/core/index"' has no exported member 'Renderer2'. [default] ...\node_modules\@ng-bootstrap\ng-bootstrap\tooltip\tooltip.d.ts:1:53 Module '".../node_modules/@angular/core/index"' has no exported member 'Renderer2'. [default] ...\node_modules\@ng-bootstrap\ng-bootstrap\typeahead\typeahead.d.ts:1:99 Module '".../node_modules/@angular/core/index"' has no exported member 'Renderer2'. [default] ...\node_modules\@ng-bootstrap\ng-bootstrap\util\popup.d.ts:1:60 Module '".../node_modules/@angular/core/index"' has no exported member 'Renderer2'.

How do I change my system so I no longer get these errors, I still have to use angular 2 upgrading is not an option.

My angular version: PS C:\wamp\www\nationalgrid\public_cli> ng version angular-cli: 1.0.0-beta.21 node: 6.11.2 os: win32 x64

I have the following in my package.json file { "name": "a2-cli-app", "version": "0.0.0", "license": "MIT", "angular-cli": {}, "scripts": { "start": "ng serve", "lint": "tslint \"src/*/.ts\"", "test": "ng test", "pree2e": "webdriver-manager update", "e2e": "protractor" }, "private": true, "dependencies": { "@angular/common": "^2.2.1", "@angular/compiler": "^2.2.1", "@angular/core": "^2.2.1", "@angular/forms": "^2.2.1", "@angular/http": "^2.2.1", "@angular/platform-browser": "^2.2.1", "@angular/platform-browser-dynamic": "^2.2.1", "@angular/router": "^3.2.1", "angular2-cookie": "^1.2.5", "bootstrap": "^3.3.7", "chart.js": "^2.4.0", "core-js": "^2.4.1", "ng2-bs3-modal": "^0.10.4", "ng2-charts": "1.4.1", "ng2-file-upload": "1.1.4-2", "ng2-pagination": "1.0.1", "ng2-toastr": "1.3.2", "rxjs": "5.0.0-beta.12", "ts-helpers": "^1.1.1", "zone.js": "^0.6.23" }, "devDependencies": { "@angular/compiler-cli": "^2.2.1", "@types/jasmine": "2.5.38", "@types/node": "^6.0.42", "angular-cli": "1.0.0-beta.21", "codelyzer": "~1.0.0-beta.3", "jasmine-core": "2.5.2", "jasmine-spec-reporter": "2.5.0", "karma": "1.2.0", "karma-chrome-launcher": "^2.0.0", "karma-cli": "^1.0.1", "karma-jasmine": "^1.0.2", "karma-remap-istanbul": "^0.2.1", "protractor": "4.0.9", "ts-node": "1.2.1", "tslint": "3.13.0", "typescript": "~2.0.3", "webdriver-manager": "10.2.5", "webpack": "^3.4.1" } }

Thanks in advance Andy

robisim74 commented 7 years ago

@stephenad You are in the wrong repository. You are getting your error from ng-bootstrap However the problem is the same: you have to use a version compatible with Angular v2, and not v4 (renderer2 is used in Angular v4). This is the last version of ng-bootstrap that seems support Angular v2: https://github.com/ng-bootstrap/ng-bootstrap/blob/master/CHANGELOG.md#100-alpha22-2017-03-24 Regarding angular-l10n you have to use v2.0.10: https://github.com/robisim74/angular-l10n/releases/tag/v2.0.10

stephenad commented 7 years ago

Hi @robisim74,

I can see I have ng-bootstrap 3.10.10 npm ng-bootstrap -version 3.10.10

To resolve this do i need to uninstall this and then install V2.0.10?

I am new to angular so still trying to get my head around how this all works.

Thanks Andy

robisim74 commented 7 years ago

V2.0.10 is related to this library (angular-l10n) not to ng-boostrap.

Which ng-boostrap are are using (there are different bootstrap for Angular)? You have to find an its version compatible with Angular v2.

stephenad commented 7 years ago

@robisim74,

How do I find out what ng-bootstrap I am using where can I see this information. This project was setup by a person before me so I am trying to learn it all and make changes for the customer at the same time, but avoid breaking it in the process.

Thanks

robisim74 commented 7 years ago

I don't see ng-bootstrap in the package.json you have posted: so go to _nodemodules/../ng-bootstrap and check the name of the package and the version in the package.json file. Then go to the official repository, get the changelog, and a version compatible with Angular v2. Finally uninstall/install the package.

P.S. When you type:

npm ng-bootstrap -version

you are getting your npm version, and not the version of the package...

Greetings

stephenad commented 7 years ago

Hi Robisim,

Thanks for the help I have now got rid of those errors.

Andy