【问题标题】:Nativescript ios build failsNativescript ios 构建失败
【发布时间】:2016-12-20 16:08:54
【问题描述】:

我正在尝试为 iOS 构建我的应用,但出现此错误:

Successfully prepared plugin tns-core-modules for ios.
Processing node_modules failed. TypeError: str.replace is not a function

我不明白为什么这只发生在为 iOS 构建时(android 工作正常)。 我已经尝试过添加/删除平台、更新 nativescript 等。 这是我关于运行版本的 package.json 部分

  "nativescript": {
    "id": "com.xxxxx.app",
    "tns-android": {
      "version": "2.4.0"
    },
    "tns-ios": {
      "version": "2.4.0"
    }
  },
  "dependencies": {
    "tns-core-modules": "^2.4.0"
  },

我的打字稿版本是 1.8。 这可能是什么原因? 这是我的tsconfig.json

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es5",
        "sourceMap": false,
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true,
        "noEmitHelpers": true,
        "noEmitOnError": true
    },
    "exclude": [
        "node_modules",
        "platforms"
    ]
}

【问题讨论】:

  • 您在设置中使用的是 typescript 还是 javascript?
  • 打字稿 1.8.10
  • 你可以发布你的 tsconfig.json 吗?
  • @hypery2k 更新了问题 :) 感谢您的宝贵时间!

标签: nativescript


【解决方案1】:

也许您缺少参考设置。我一直在使用 NativeScript 和 TypeScript 2+。请查看此示例应用程序,也许您会将其与您的设置进行比较:https://github.com/TobiasHennig/nativescript-toast/tree/master/samples/angular

【讨论】:

    【解决方案2】:

    我不得不删除hooksbin并重新安装ios平台。

    【讨论】:

      猜你喜欢
      • 2019-02-25
      • 2019-08-04
      • 1970-01-01
      • 2018-06-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多