Skip to content

Fix upgrade of CLI #2462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 31, 2017
Merged

Fix upgrade of CLI #2462

merged 1 commit into from
Jan 31, 2017

Conversation

rosen-vladimirov
Copy link
Contributor

At the moment when you have CLI 2.4.x and you try installing newer version (2.5.x), installation fails with EEXIST error for bin/tns. The problem is that in 2.5.0 we've tried to simplify the files that we have in CLI's bin dir.
However npm acts a little bit strange to these changes. In NativeScript 2.4.x, when CLI is installed globally, npm makes symlink to CLI's bin/nativescript.js file. We've removed this file, and in version 2.5.x the symlink should point to bin/tns file. However during upgrade (when you have version 2.4.x or earlier installed globally) npm does not delete the symlink to bin/nativescript.js and later fails.
This can be fixed by manually uninstalling 2.4.x version and installing 2.5.x after that.
In order to allow upgrade to version 2.5.x when you already have earlier version installed, get back the bin/nativescript.js file. This way npm successfully creates the new symlink to bin/tns. We can delete the bin/nativescript.js in 2.6.x or later.

At the moment when you have CLI 2.4.x and you try installing newer version (2.5.x), installation fails with EEXIST error for bin/tns. The problem is that in 2.5.0 we've tried to simplify the files that we have in CLI's bin dir.
However `npm` acts a little bit strange to these changes. In NativeScript 2.4.x, when CLI is installed globally, npm makes symlink to CLI's `bin/nativescript.js` file. We've removed this file, and in version 2.5.x the symlink should point to `bin/tns` file. However during upgrade (when you have version 2.4.x or earlier installed globally) npm does not delete the symlink to `bin/nativescript.js` and later fails.
This can be fixed by manually uninstalling 2.4.x version and installing 2.5.x after that.
In order to allow upgrade to version 2.5.x when you already have earlier version installed, get back the `bin/nativescript.js` file. This way npm successfully creates the new symlink to `bin/tns`. We can delete the `bin/nativescript.js` in 2.6.x or later.
@vchimev
Copy link

vchimev commented Jan 30, 2017

I'm not able to reproduce such an issue.

@rosen-vladimirov
Copy link
Contributor Author

We've investigated the issue with @vchimev . The issue is specific to npm version. It's reproducible with npm 3.10.8, but not with 3.10.10

@rosen-vladimirov rosen-vladimirov merged commit 99e1ad6 into release Jan 31, 2017
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/fix-upgrade-cli branch January 31, 2017 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants