Version strings are not in the same format


I just have installed Nativescript on my macOS Sierra 10.12.12.
But when i enter the command: tns platfrom add ios I get the following error message:

Version strings are not in the same format
#platform add

When I enter the same command for Android everything works fine.

tns doctor gives me the following feedback:

Your components are up-to-date.
No issues were detected.

I hope somebody can help me, the tns version is 2.5.2

Thank you in advance!


Normally I create a new project, and then run tns run ios to get started. Can you try that and see what happens?


Hello Jen,

Everything works ok when I create an app, I have created the HelloWorld app. The problem occurs when I try to add a iOS platform.

Version strings are not in the same format
#platform add

I really can not find out what the problem is, because when I add a Android platform everything works as it should.

Did I forget something?


i have the same problem!


Hope we can solve this, this is my second day trying to fix this. Want to get started with NativeScript :slight_smile:

tns platform add ios --log trace > log.txt
Error: Version strings are not in the same format
at Object.versionCompare (/usr/local/lib/node_modules/nativescript/lib/common/helpers.js:111:15)
at /usr/local/lib/node_modules/nativescript/lib/services/ios-project-service.js:92:25
at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
at FiberFuture.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)
at /usr/local/lib/node_modules/nativescript/lib/services/platform-service.js:69:47
at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
at FiberFuture.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)
at _.each.platform (/usr/local/lib/node_modules/nativescript/lib/services/platform-service.js:55:58)
at arrayEach (/usr/local/lib/node_modules/nativescript/node_modules/lodash/lodash.js:451:11)
at Function.forEach (/usr/local/lib/node_modules/nativescript/node_modules/lodash/lodash.js:8634:14)


i use mac.

           which head

should give

there may be a problem if it returns something like

it is because they are different utilities!

which head

Gives me: /usr/bin/head


xcodebuild -version | head -n 1 | sed -e ‘s/Xcode //’

Gives me:


Gives me: 8.2.1

Really frustrating


I don’t know whether need the steps discussed in or not!


i will put


in function versionCompare() of helpers.js
and see why the version formats are different!


@jolee have you tried to compare version 1 and version 2?


Ok, i have been debugging and found a “solution”. Not the best solution but everything works now!

I have edited the following file: /usr/local/lib/node_modules/nativescript/lib/services/ios-project-service.js

When I comment out the code on line 91 till line 94 everything works perfect! What is being compared here and how to fix this?

let xcodeBuildVersion = this.getXcodeVersion(); if (helpers.versionCompare(xcodeBuildVersion, IOSProjectService.XCODEBUILD_MIN_VERSION) < 0) { this.$"NativeScript can only run in Xcode version %s or greater", IOSProjectService.XCODEBUILD_MIN_VERSION); }


in my case , they are

version1: 8.0
version2: 6.0


getXcodeVersion() convert format x.y.z to x.y
then, compare version1 with the required min version 6.0

so i think the problem should be version1 is not in the valid format x.y


Did you find a fix ?



i just rename the head utility in XAMPP to xhead. and, everything work fine!



Hey jolee, can you share snippet how did you changed this?


ok, I just renamed head utility to xhead, and didn’t changed anything else… apache is working and can add platform


In terminal, I type:

mv /Applications/XAMPP/bin/HEAD /Applications/XAMPP/bin/xhead

I just do this only and everything work fine!