0

I have brought SmartAdmin Theme for development of my project,It worked great with Angularjs but when i try to run it for Angular2 it shows lot of errors.I have screen shots attached for the issue,take a look and let me know. Thank you.enter image description here

Errors displayed when running the theme

This is my package.json:

 {
  "name": "smartadmin",
  "version": "0.1.9",
  "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.0.1",
    "@angular/compiler": "2.0.1",
    "@angular/core": "2.0.1",
    "@angular/forms": "2.0.1",
    "@angular/http": "2.0.1",
    "@angular/platform-browser": "2.0.1",
    "@angular/platform-browser-dynamic": "2.0.1",
    "@angular/router": "3.0.1",
    "X-editable": "github:vitalets/x-editable",
    "bootstrap": "^3.3.7",
    "bootstrap-colorpicker": "^2.3.5",
    "bootstrap-duallistbox": "github:istvan-ujjmeszaros/bootstrap-duallistbox",
    "bootstrap-markdown": "^2.10.0",
    "bootstrap-progressbar": "^0.9.0",
    "bootstrap-slider": "^9.1.3",
    "bootstrap-tagsinput": "^0.7.1",
    "bootstrap-timepicker": "^0.5.2",
    "chart.js": "2.3.0",
    "ckeditor": "^4.5.10",
    "clockpicker": "0.0.7",
    "clone": "^1.0.2",
    "core-js": "^2.4.1",
    "debounce": "^1.0.0",
    "dropzone": "^4.3.0",
    "dygraphs": "^1.1.1",
    "fuelux": "^3.15.8",
    "he": "^1.1.0",
    "highcharts": "^4.2.7",
    "ion-rangeslider": "^2.1.4",
    "jquery": "^2.2.4",
    "jquery-color": "^1.0.0",
    "jquery-jcrop": "^0.9.13",
    "jquery-knob": "^1.2.11",
    "jquery-ui-npm": "^1.12.0",
    "jquery-validation": "^1.15.1",
    "jquery.maskedinput": "^1.4.1",
    "jvectormap": "^2.0.4",
    "markdown": "^0.5.0",
    "morris.js": "^0.5.0",
    "ng2-bootstrap": "^1.1.5",
    "ng2-popover": "git+https://github.com/griga/ng2-popover.git",
    "ng2-redux": "^4.0.0-beta.0",
    "nouislider": "^8.5.1",
    "raphael": "^2.2.1",
    "redux": "^3.6.0",
    "rxjs": "5.0.0-beta.12",
    "scriptjs": "^2.5.8",
    "select2": "^4.0.3",
    "smartadmin-plugins": "^1.0.13",
    "summernote": "^0.8.1",
    "to-markdown": "^3.0.1",
    "ts-helpers": "^1.1.1",
    "zone.js": "^0.6.23"
  },
  "devDependencies": {
    "@types/jasmine": "^2.2.30",
    "angular-cli": "1.0.0-beta.15",
    "codelyzer": "~0.0.26",
    "expose-loader": "^0.7.1",
    "imports-loader": "^0.6.5",
    "jasmine-core": "2.5.1",
    "jasmine-spec-reporter": "2.7.0",
    "karma": "1.3.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",
    "script-loader": "^0.7.0",
    "ts-node": "1.2.1",
    "tslint": "3.13.0",
    "typescript": "2.0.2"
  }
}
  • Look at this answer: http://stackoverflow.com/a/41444599/127826. If that doesn't help, please add more information, including the version numbers. Perhaps add your `package.json` to the question. – Cobus Kruger Mar 07 '17 at 07:37
  • I have added my package.json,please check and let me know.I tried the fix you had mentioned but it did not help. – Hrishikesh Kulkarni Mar 07 '17 at 08:59

1 Answers1

0

Update your Angular dependencies. First, change these lines in package.json:

"dependencies": {
"@angular/common": "^2.4.9",
"@angular/compiler": "^2.4.9",
"@angular/core": "^2.4.9",
"@angular/forms": "^2.4.9",
"@angular/http": "^2.4.9",
"@angular/platform-browser": "^2.4.9",
"@angular/platform-browser-dynamic": "^2.4.9",
"@angular/router": "^3.4.9",

Notice both the new version numbers and the caret (^), which roughly indicates "or later".

Then run npm install --save

I reckon you will probably get a couple of messages about unmet peer dependencies. For each of the listed packages, simply run npm install --save theListedPackage.

A handful of attempts later, all should be well.

Cobus Kruger
  • 8,338
  • 3
  • 61
  • 106
  • I could solve most of the errors and make my webpack compile successfull but after trying to open it on my browser i get the following error in my console: Uncaught TypeError: ctorParameters.map is not a function – Hrishikesh Kulkarni Mar 10 '17 at 10:10
  • Did you run `npm install` as indicated above? What does this give you? `npm list @angular/core` – Cobus Kruger Mar 10 '17 at 10:31
  • npm list @angular/core gives a list of unmet peer dependencies ...what to do with them? – Hrishikesh Kulkarni Mar 10 '17 at 10:55
  • First, it should give you the installed version of @angular/core. Second (as I stated in the answer), you need to run `npm install --save theListedPackage` for each peer dependencies. – Cobus Kruger Mar 10 '17 at 10:58