2017-02-26 124 views
1

當我在離子2中更新到最新的離子原生(2.5.1)後在終端中運行「離子發球」時,出現Typescript錯誤項目。我試圖將打印機更新到版本2.x,但仍然無法正常工作。請幫忙。離子2打字稿錯誤TS1005更新爲離子原生2.5.1

錯誤消息:

TypeScript error: ../ionic2/ionic2-angularfire-sample-master/node_modules/ionic-native/dist/es5/plugins/mixpanel.d.ts(74,21): Error TS1005: '=' expected. 
TypeScript error: ../ionic2/ionic2-angularfire-sample-master/node_modules/ionic-native/dist/es5/plugins/mixpanel.d.ts(74,27): Error TS1005: ';' expected. 
TypeScript error: ../ionic2/ionic2-angularfire-sample-master/node_modules/ionic-native/dist/es5/plugins/mixpanel.d.ts(74,29): Error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. 
TypeScript error: ../ionic2/ionic2-angularfire-sample-master/node_modules/ionic-native/dist/es5/plugins/mixpanel.d.ts(75,1): Error TS1128: Declaration or statement expected. 

我離子信息:

Your system information: 
Cordova CLI: 6.4.0 
Ionic Framework Version: 2.0.0-beta.11 
Ionic CLI Version: 2.1.1 
Ionic App Lib Version: 2.1.1 

我的package.json:

{ 
    "dependencies": { 
    "@angular/common": "2.0.0-rc.4", 
    "@angular/compiler": "2.0.0-rc.4", 
    "@angular/core": "2.0.0-rc.4", 
    "@angular/forms": "0.2.0", 
    "@angular/http": "2.0.0-rc.4", 
    "@angular/platform-browser": "2.0.0-rc.4", 
    "@angular/platform-browser-dynamic": "2.0.0-rc.4", 
    "@angular/router": "2.0.0-rc.2", 
    "@types/core-js": "^0.9.35", 
    "@types/lodash": "^4.14.53", 
    "angular": "^1.6.2", 
    "angularfire2": "2.0.0-beta.2", 
    "es6-shim": "0.35.0", 
    "firebase": "3.3.0", 
    "ionic-angular": "2.0.0-beta.11", 
    "ionic-native": "^2.5.1", 
    "ionicons": "3.0.0", 
    "moment": "2.13.0", 
    "reflect-metadata": "0.1.3", 
    "rxjs": "5.0.0-beta.6", 
    "zone.js": "0.6.12" 
    }, 
    "devDependencies": { 
    "@ionic/app-scripts": "^1.1.4", 
    "del": "2.2.0", 
    "gulp": "3.9.1", 
    "gulp-tsc": "^1.3.0", 
    "gulp-tslint": "^5.0.0", 
    "gulp-watch": "4.3.5", 
    "ionic-gulp-browserify-typescript": "^1.1.0", 
    "ionic-gulp-fonts-copy": "^1.0.0", 
    "ionic-gulp-html-copy": "^1.0.0", 
    "ionic-gulp-sass-build": "^1.0.0", 
    "ionic-gulp-scripts-copy": "^2.0.0", 
    "ionic-gulp-tslint": "^1.0.0", 
    "run-sequence": "1.1.5", 
    "tslint": "^3.10.1", 
    "tslint-ionic-rules": "^0.0.3", 
    "gulp-typescript": "^2.13.6", 
    "typescript": "^2.0.2", 
    "typings": "^2.1.0" 

我的打字稿版本TSC -v:

Version 2.2.1 

請幫忙。謝謝!!!

+0

用這個** mixpanel.ts **文件更新您的文章 – Aravind

回答

0

我在這裏看到很多問題。

您的Ionic Framework處於Beta

你應該做npm install -g [email protected]

要獲得Ionic項目的最新依賴關係,可以參考starter base here的package.json。這些是您在執行ionic start proj --v2 template_name時下載的依賴關係。

注意: 即使這個package.json指定離子本機版本2.4.1和應用程序腳本1.1.3而您的提到更高。

+0

感謝您的回覆。在我做了'npm install -g ionic @ latest'之後,又出現了另一個問題:'錯誤:無法找到模塊'@ angular/tsc-wrapped/src/tsc''。請幫忙。 @suraj –

+0

你檢查了package.json嗎? –

+0

您的意思是我需要將新項目中創建的新package.json添加到當前項目中? –