nativescriptnpm-installnativescript-cli

How to update nativescript cli


Nativescript 5 is out and I am trying to update the tns version. Currently it tns --version shows as 4.3.2.

I followed all the steps in https://docs.nativescript.org/releases/upgrade-instructions but it still gives me the version as 4.3.2.

How can I upgrade nativescript-cli so that tns --version shows me the latest version.


Solution

  • I did following to reflect the update Nativescript cli. You should only follow this when npm install -g nativescript@latest doesn't reflect update the cli. You can check that using tns --version before and after.

    1. Uninstall current nativescript cli using npm uninstall -g nativescript
    2. Delete the existing tns command manuall if it still exist on your machine.
    3. Install the latest Nativescript cli using npm install -g nativescript@latest
    4. tns --version should now show the latest version.