【问题标题】:Nativescript error: Version strings are not in the same formatNativescript 错误:版本字符串的格式不同
【发布时间】:2017-03-12 12:36:19
【问题描述】:

我刚刚在我的 macOS Sierra 10.12.12 上安装了 Nativescript。但是当我输入命令时:tns platfrom add ios 我收到以下错误消息:

*Version strings are not in the same format*

*#platform add*

当我为 Android 输入相同的命令时,一切正常。

tns 医生给我以下反馈:

*Your components are up-to-date.*

*No issues were detected.*

日志跟踪:

ns 平台添加 ios --log trace > log.txt 错误:版本字符串的格式不同 在 Object.versionCompare (/usr/local/lib/node_modules/nativescript/lib/common/helpers.js:111:15) 在 /usr/local/lib/node_modules/nativescript/lib/services/ios-project-service.js:92:25 在 Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26) 在 FiberFuture.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10) 在 /usr/local/lib/node_modules/nativescript/lib/services/platform-service.js:69:47 在 Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26) 在 FiberFuture.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10) 在 .each.platform (/usr/local/lib/nodemodules/nativescript/lib/services/platform-service.js:55:58) 在 arrayEach (/usr/local/lib/node_modules/nativescript/node_modules/lodash/lodash.js:451:11) 在 Function.forEach (/usr/local/lib/node_modules/nativescript/node_modules/lodash/lodash.js:8634:14)

【问题讨论】:

  • 你能粘贴你的项目的 package.json 吗?此外,如果您使用模板启动器,您将有两个包文件。一个用于您的应用程序,一个用于模板启动器。要检查的另一件事是您在机器上安装了哪个版本的 nativescript。
  • 您是否安装了 Xcode 以及哪个版本?此外,某些第三方软件(例如 XAMPP)可能会导致无法识别检查 XCode 版本的命令 - 有关此问题的更多详细信息和可能的解决方案:github.com/NativeScript/nativescript-cli/issues/…
  • 你好 :) 我的 tns 版本:2.5.2 和 Xcode 8.2.1。我也删除了 XAMPP,但问题仍然存在。

标签: telerik nativescript


【解决方案1】:

@布拉德·马丁 这是我的 package.json 文件:

{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "org.nativescript.HelloWorld",
    "nativescript-teststudio-variables": {
      "IOS_APP_URL": "telerikmt1"
    },
    "tns-android": {
      "version": "2.5.0"
    }
  },
  "dependencies": {
    "@angular/common": "2.4.3",
    "@angular/compiler": "2.4.3",
    "@angular/core": "2.4.3",
    "@angular/forms": "2.4.3",
    "@angular/http": "2.4.3",
    "@angular/platform-browser": "2.4.3",
    "@angular/platform-browser-dynamic": "2.4.3",
    "@angular/router": "3.4.3",
    "nativescript-angular": "1.4.0",
    "nativescript-teststudio": "^1.1.4",
    "nativescript-theme-core": "~1.0.2",
    "reflect-metadata": "~0.1.8",
    "rxjs": "~5.0.1",
    "tns-core-modules": "^2.5.1"
  },
  "devDependencies": {
    "babel-traverse": "6.23.1",
    "babel-types": "6.23.0",
    "babylon": "6.16.1",
    "lazy": "1.0.11",
    "nativescript-dev-android-snapshot": "^0.*.*",
    "nativescript-dev-typescript": "^0.3.5",
    "typescript": "~2.1.0",
    "zone.js": "~0.7.2"
  }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-27
    相关资源
    最近更新 更多