Nativescript-cli: [2.5.*] tns run always add latest platform

Created on 5 May 2017  ยท  7Comments  ยท  Source: NativeScript/nativescript-cli

_From @3rror404 on May 4, 2017 15:52_

I'm still using N 2.5.4 as I don't have time to upgrade to version 3 yet.

After I removed the iOS platform and re-added I noticed that the platform had been upgraded to 3.0.0. After removing the platform again and reinstalling the 2.5.0 version with tns platform add [email protected] I can no longer run my project.

Project successfully prepared (ios)
Searching for devices...
Building project...
Expected "// !$*UTF8*$!" but "<" found.
# run ios

I've tried numerous things including removing iOS and installing the 3.0.0 version. Removing the hooks, node_modules and platforms folders all with the same result.

Any ideas?

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Component        โ”‚ Current version โ”‚ Latest version โ”‚ Information      โ”‚
โ”‚ nativescript     โ”‚ 2.5.4           โ”‚ 3.0.0          โ”‚ Update available โ”‚
โ”‚ tns-core-modules โ”‚ 2.5.2           โ”‚ 3.0.0          โ”‚ Update available โ”‚
โ”‚ tns-android      โ”‚ 3.0.0           โ”‚ 3.0.0          โ”‚ Up to date       โ”‚
โ”‚ tns-ios          โ”‚ 2.5.0           โ”‚ 3.0.0          โ”‚ Update available โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

_Copied from original issue: NativeScript/NativeScript#4115_

bug critical

Most helpful comment

@m-abs, @3rror404, @Cae2 Fix is available in {N} 2.5.5

npm un -g nativescript
npm cache clean
npm i -g [email protected]

All 7 comments

Hi @3rror404 ,
Thank you for reporting this issue.

I tested it on my side and I have to confirm that this is a real issue, while using an old CLI.
If we have an old project, using runtime 2.5.0 and build with tns run <platform_name> tns-iosandtns -android` will be automatically updated to version 3.0.

Workaround:

  1. tns platform remove <platform_name>
  2. tns platform add <platform_name>@2.5.0
  3. tns prepare <platform_name>
  4. tns run <platform_name>

I think that this workaround isnt working with me.. I'm using tns 2.5.4 and it is still installing tns-android 3

3 0

Same here.

Hi @Cae2, @3rror404
Excuse me for the mistake. I forgot to specify the runtime version while adding the platform. For example: tns platform add <platform_name>@2.5.0. I also update my previous answer.
Now the workaround should work for you.

I did actually try that thinking that you might have made a mistake and I still received the same error:

Expected "// !$*UTF8*$!" but "<" found.

The workaround doesn't work when I try publish a bundled version.
ns-bundle removes the platform and adds it against, so I'm still have [email protected].

@m-abs, @3rror404, @Cae2 Fix is available in {N} 2.5.5

npm un -g nativescript
npm cache clean
npm i -g [email protected]
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ZMW9 picture ZMW9  ยท  3Comments

DimitarTachev picture DimitarTachev  ยท  3Comments

erjdriver picture erjdriver  ยท  3Comments

trodellez picture trodellez  ยท  3Comments

Fatme picture Fatme  ยท  3Comments