Nativescript-cli: `tns update <version>` does not work

Created on 7 Nov 2017  Â·  17Comments  Â·  Source: NativeScript/nativescript-cli

Help says:

tns update --help
# platform update

│ Usage                          │ Synopsis               │
│ Update with the latest version │ $ tns update           │
│ Update with specific version   │ $ tns update <version> │

Updates a NativeScript project to the latest (or specified) version.

tns update 3.3.0 results in:

Invalid platform 3.3.0. Valid platforms are ios or android.
bug

All 17 comments

I cannot upgrade to version 3.3.0. I hope this is fixed soon.

Is this fixed or not?

Hi @erkanarslan,
The fix for the issue is merged in master branch and is being verified by our QA team. The fix should be included in the next official release.
As a temporary workaround you can use tns platform remove <platform> and then tns platform add <platform>@version. If you need to update the CLI tooling you can use npm remove nativescript -g and then npm i nativescript -g.
I'd also like to remind you that the update command will not update the CLI (nativescript package), and you will have to handle it manually.

I still have the issue to update nativescript to 3.4.3.... Any suggest?
Now I can't use Sidekick because it needs the 3.4.3 of nativescript cli to works

hey @marcocasadio,

Can you give us more information about the issue you have? Are you using update command or npm install? Please tell us how to recreate the issue in as much detail as possible.

Hi @Fatme!
I run "tns update 3.4.3" and I get "Could not update the project!"
I've a project with angular + typescript.
I've tried to remove nativescript and reinstall with the commands wrote by @KristianDD but I always get the 3.4.2 version and I can't use Sidekick.

I have this same issue trying to update to 3.4.3. I also cannot use Sidekick and I need it asap.

Hey @marcocasadio , @sroy93 ,
Can you try the following commands:

$ npm cache clean --force
$ npm uninstall -g nativescript
$ which tns # This command will show you if you have installed NativeScript CLI somewhere else - it should return empty result in case the package is not installed anywhere
$ npm install -g nativescript@latest

This should install the latest version of NativeScript CLI on your side.

@rosen-vladimirov now it seems ok! (@sroy93)
after the uninstall I launched these commands: https://docs.npmjs.com/misc/removing-npm

thanks

It seems as though nativescript will not uninstall.. Even after I run the uninstall command, I can do
tns --version and get a result back..

What directory should I be starting in when I execute these commands?

@sroy93 I had your same issue. I also removed npm and reinstalled with nvm. I did the commands from my home folder.

I think I figured something out, I just don’t know what to do about it… I believe that maybe nativescript is installed somewhere other than the npm folder… I say this because I can uninstall Nativescript with the npm commands and the nativescirpt folder disappears from within the npm folder. However, it is definitely still installed somewhere, somehow… I can run tns doctor and get the current version. Is there a way for me to check where else it’s installed? And/Or a way for me to uninstall it other than using the npm command?

Hey @sroy93 , you can use which tns on macOS and Linux and where tns on Windows to get the path where NativeScript CLI is installed. After you find it, you can remove it and use the same command to see if it is not installed somewhere else.

Ah okay, thank you @rosen-vladimirov !! In order to remove it, do I just delete the folder that contains it?

@sroy93, how did you remove it? I have the same issue, but no-one seems to offer any advice on how to actually remove the other installation once you have run which tns and found it!

It's been a while since I did this.. I know I have notes on it somewhere, but I am going to have to dig to find them.
I want to say I had to run my command prompt as administrator and navigate to the folder where I found the install at and run the uninstall commands there. That, or remove the files manually as admin and then try.
I will look for my notes. Let me know if either of those suggestions help.

I am updating nativescript: I am using tns update next command to update angular-nativescript project. I want to use latest tns. I am using sharing project. which is used for mobile and web.

When I am use tns update next it gives me below error.

Could not update the project! Reason is: Unable to execute update as package @nativescript/webpack does not have version/tag next. Please enter valid version or npm tag.

Was this page helpful?
0 / 5 - 0 ratings