'Observable' is not a class derived from 'Observable'

前端 未结 9 2452
灰色年华
灰色年华 2020-12-29 18:11

When trying to extend a class from a class in a node_modules the typescript compiler throws a error saying:

Property \'source\' is protected but

9条回答
  •  太阳男子
    2020-12-29 19:02

    actually may this problem comes due to your typescript version change

    try to change your typescript version

    1. You can find that in

      package.json

    set to 2.4.3

    1. if not work then simply try on cli

      npm unlink typescript

      npm install typescript@2.3.4

    and after installation complete packages.json

    plz check it should be work in dependencies

    "dependencies": {
    "@angular/animations": "^5.2.0",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/router": "^5.2.0",
    "core-js": "^2.4.1",
    "rxjs": "5.4.3",
    "typescript": "^2.3.4", <<---------------remove ^
    "zone.js": "^0.8.19"

    but one thing is clear it is not error this is due to environment change

    if still facing problem then try reinstall node module

    good luck.......

提交回复
热议问题