2017-03-07 60 views
0

我爲我的項目開發帶來了SmartAdmin主題,它與Angularjs很好地工作,但是當我嘗試爲Angular2運行它時,它顯示了很多錯誤。這個問題的附加鏡頭,請看看,讓我知道。 謝謝。 enter image description here我在角2中運行我的smartadmin主題時遇到了一些困難

Errors displayed when running the theme

這是我的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" 
    } 
} 
+0

看看這個答案:http://stackoverflow.com/a/41444599/127826。如果這沒有幫助,請添加更多信息,包括版本號。也許把你的'package.json'添加到問題中。 –

+0

我已經添加了我的package.json,請檢查並告訴我。我嘗試了您提到的修復程序,但沒有幫助。 –

回答

0

更新您的角度依賴性。首先,在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", 

注意兩個新的版本號和插入符號(^),這大致表示「或更高版本」。

然後運行npm install --save

我想你可能會得到一對夫婦約未滿足的同行依賴消息。對於每個列出的軟件包,只需運行npm install --save theListedPackage

稍後的一些嘗試,一切都會好的。

+0

我可以解決大部分的錯誤,並使我的webpack編譯成功,但試圖在我的瀏覽器上打開它後,我的控制檯中出現以下錯誤:Uncaught TypeError:ctorParameters.map不是函數 –

+0

您運行了'npm install'嗎?如上所述?這給你什麼? 'npm list @ angular/core' –

+0

npm list @ angular/core給出了一個未滿足的對等關係列表......如何處理它們? –

相關問題