0

I am trying to implement Tree View Like

Angular Version: 4

I copied the related code from above link and paste in my app components but it's showing an error:

So I am looking for the solution like, How I upgrade from 4 to 5 (Is it necessary only for this module) Or how to solve those compile time errors

Typescript error Cannot find module '@angular/core'

Typescript error Cannot find module 'rxjs'

Package.Json:

{
  "name": "kalpavriksha-angular-v4",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@agm/core": "^1.0.0-beta.1",
    "@agm/snazzy-info-window": "^1.0.0-beta.1",
    "@angular/animations": "^4.4.6",
    "@angular/cdk": "^2.0.0-beta.12",
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/core": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/material": "^2.0.0-beta.12",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/router": "^4.0.0",
    "@swimlane/ngx-charts": "^6.1.0",
    "@types/filesaver": "0.0.30",
    "angular-chat": "^1.0.9",
    "angular-datatables": "^4.2.0",
    "angular-file-picker": "^1.2.0",
    "angular-file-saver": "^1.1.3",
    "angular-material": "^1.1.5",
    "angularfire2": "5.0.0-rc.3",
    "angularjs-bootstrap-datetimepicker": "^1.1.4",
    "chart.js": "^2.7.2",
    "chart.piecelabel.js": "^0.11.0",
    "cloudboost": "^2.0.264",
    "core-js": "^2.4.1",
    "d3": "^4.11.0",
    "datatables.net": "^1.10.16",
    "datatables.net-buttons": "^1.4.2",
    "datatables.net-buttons-dt": "^1.4.2",
    "datatables.net-dt": "^1.10.16",
    "datatables.net-select": "^1.2.3",
    "datatables.net-select-dt": "^1.2.3",
    "file-saver": "^1.3.3",
    "firebase": "4.6.0",
    "hammerjs": "^2.0.8",
    "material-design-icons": "^3.0.1",
    "md-date-picker": "^0.1.0",
    "ng-chat": "^1.0.12",
    "ng-snotify": "^4.0.0",
    "ng2-charts": "^1.6.0",
    "ng2-search-filter": "^0.3.1",
    "ng4-loading-spinner": "^1.0.27",
    "ngx-cookie-service": "^1.0.9",
    "ngx-loading": "^1.0.7",
    "ngx-pagination": "^3.1.0",
    "ngx-progress-bar": "0.0.10",
    "rxjs": "^5.4.3",
    "snazzy-info-window": "^1.1.0",
    "time-ago-pipe": "^1.3.2",
    "zone.js": "^0.8.14"
  },
  "devDependencies": {
    "@angular/cli": "1.4.1",
    "@angular/compiler-cli": "^4.0.0",
    "@angular/language-service": "^4.0.0",
    "@types/datatables.net": "^1.10.6",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/jquery": "^3.2.12",
    "@types/node": "~6.0.60",
    "codelyzer": "~3.0.1",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~3.0.4",
    "tslint": "~5.3.2",
    "typescript": "~2.3.3"
  }
}
3
  • try running npm install once again Commented Jul 24, 2018 at 13:02
  • Yes I tried npm install but still, errors are there Commented Jul 24, 2018 at 13:10
  • I event tried to install each module like @angular/core etc by manually but not work Commented Jul 24, 2018 at 13:11

1 Answer 1

1

There are some couple of changes in your package.json file change your

"rxjs": "^5.4.3", 

to

"rxjs": "5.5.6" 

also, update your angular/core by

npm install --save-dev @angular/core@latest

here are the more details if you want regarding update issue.

Sign up to request clarification or add additional context in comments.

5 Comments

Getting error: The specified command update is invalid. For available options, see ng help`.
Now only one error is there : Argument of type '(node: TodoItemNode) => TodoItemNode[]' is not assignable to parameter of type '(node: TodoItemNode) => Observable<TodoItemNode[]>'. Type 'TodoItemNode[]' is not assignable to type 'Observable<TodoItemNode[]>'. Property '_isScalar' is missing in type 'TodoItemNode[]'.
:) this is your development error not angular error you need to debug this!
Is it because of Typescript version? Or RxJS
I think because of RXJS check your RXJS import in that file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.