Sadid Khan
Sadid Khan

Reputation: 1985

error TS2305: Module "/node_modules/rxjs/Rx" has no exported member 'Subscribable'

I have a project that is built in angular 5. here is the package.json

{
  "name": "ff-client",
  "version": "0.2.0",
  "license": "",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint --type-check",
    "e2e": "ng e2e",
    "xprecommit": "ng lint --type-check && ng test --single-run --code-coverage",
    "xprepush": "ng build --prod",
    "i18n": "ng xi18n --i18n-format xlf --output-path src/locale --locale en --progress",
    "i18n-merge": "xliffmerge --profile xliffmerge.json",
    "browserstack": "ng e2e --no-serve --config protractor.browserstack.conf.js",
    "upgrade": "yarn upgrade-interactive --latest",
    "build-en": "ng build --prod --e deploy --output-path=dist/en --i18nFile=src/locale/messages.en.xlf --i18nFormat=xlf --locale=en --base-href /en/",
    "build-da": "ng build --prod --e deploy --output-path=dist/da --i18nFile=src/locale/messages.da.xlf --i18nFormat=xlf --locale=da --base-href /da/",
    "build-fo": "ng build --prod --e deploy --output-path=dist/fo --i18nFile=src/locale/messages.fo.xlf --i18nFormat=xlf --locale=fo --base-href /fo/",
    "build-root": "copy dist\\en\\web.config dist\\ && del dist\\en\\web.config && del dist\\da\\web.config && del dist\\fo\\web.config",
    "build-prod": "npm run build-en && npm run build-da && npm run build-fo && npm run build-root"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "5.2.9",
    "@angular/cdk": "^5.2.4",
    "@angular/common": "5.2.9",
    "@angular/compiler": "5.2.9",
    "@angular/core": "5.2.9",
    "@angular/flex-layout": "^5.0.0-beta.14",
    "@angular/forms": "5.2.9",
    "@angular/http": "5.2.9",
    "@angular/material": "^5.2.4",
    "@angular/platform-browser": "5.2.9",
    "@angular/platform-browser-dynamic": "5.2.9",
    "@angular/router": "5.2.9",
    "@angular/service-worker": "5.2.9",
    "@aspnet/signalr": "^1.0.0-rc1-update1",
    "@auth0/angular-jwt": "^1.0.0-beta.9",
    "@ngrx/effects": "^5.1.0",
    "@ngrx/router-store": "^5.0.1",
    "@ngrx/store": "^5.1.0",
    "@ngrx/store-devtools": "^5.1.0",
    "angular-in-memory-web-api": "^0.5.2",
    "applicationinsights-js": "^1.0.15",
    "core-js": "^2.5.3",
    "hammerjs": "^2.0.8",
    "moment": "^2.20.1",
    "ng-recaptcha": "^3.0.3",
    "ng2-file-upload": "^1.3.0",
    "ngrx-store-logger": "^0.2.0",
    "ngx-perfect-scrollbar": "^5.3.5",
    "redux-beacon": "^1.2.1",
    "rxjs": "^5.5.8",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular/cli": "1.7.4",
    "@angular/compiler-cli": "5.2.9",
    "@angular/language-service": "5.2.9",
    "@types/jasmine": "~2.8.6",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~9.4.6",
    "chai": "^4.1.2",
    "codelyzer": "~4.1.0",
    "cucumber": "^4.0.0",
    "husky": "^0.14.3",
    "jasmine-core": "~2.99.1",
    "jasmine-marbles": "^0.2.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.4.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "karma-teamcity-reporter": "^1.0.1",
    "ngx-i18nsupport": "^0.12.0",
    "protractor": "^5.3.0",
    "protractor-cucumber-framework": "^4.2.0",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "2.6.2"
  }
}

I have download npm and angular-cli.enter image description here

after installing these, I did npm install to get the required modules. but when I do "ng serve" it shows an error.

ERROR in node_modules/@angular/flex-layout/core/typings/observable-media/observa ble-media.d.ts(1,22): error TS2305: Module '"D:/Projects/FlexFunding/app-dk/Clie
nt/node_modules/rxjs/Rx"' has no exported member 'Subscribable'.

enter image description here

I know now it is angular 6 and rxjs has updated in this version. but how can I solve this issue without migrating this project from angular version 5 to 6. I just need to build and run the project.

i have tried replace rxjs folder under node modules from a running a project. but no luck.

Edit: I have uninstall current version and downgraded to version angular cli version 1.7.4 but the error is same.

Upvotes: 0

Views: 3322

Answers (2)

Sadid Khan
Sadid Khan

Reputation: 1985

ERROR in node_modules/@angular/flex-layout/core/typings/observable-media/observa ble-media.d.ts(1,22): error TS2305: Module '"D:/Projects/FlexFunding/app-dk/Clie nt/node_modules/rxjs/Rx"' has no exported member 'Subscribable'.

in package.json one of the dependency is

"@angular/flex-layout": "^5.0.0-beta.14"

for ^ of "^5.0.0-beta.14", npm installs the latest version of flex-layout and in the latest version felx-layout uses RxJS 6. But as the project is an Angular 5 project, it uses previous version of RxJs. So, flex-layout failed to import the required libraries because RxJs 6 is not there.

so, the solution that worked for me is to change package.json

"@angular/flex-layout": "5.0.0-beta.14"

then npm install

Upvotes: 2

Kamil Naja
Kamil Naja

Reputation: 6692

Try reinstall your application

npm i

If this doesn't work, try delete node_modules folder and reinstall.

Upvotes: 0

Related Questions