Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19470] CLI: ti setup doesn't properly select last available versions from npm

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2015-09-09T16:13:06.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.0.0
ComponentsTooling
Labelssetup
ReporterFokke Zandbergen
AssigneeChris Barber
Created2014-10-29T09:09:59.000+0000
Updated2015-09-17T17:09:51.000+0000

Description

When I run ti setup and select *check* I get:
Node.js
  ✓  node               up-to-date (v0.10.33)
  ★  npm                new version v2.1.6 available! (currently v2.1.5)
However, on https://www.npmjs.org/package/npm and via npm info npm it has *2.1.5* as the last version. The versions array does have 2.1.6 but the CLI should look at version not versions.

Related code

https://github.com/appcelerator/titanium/blob/master/lib/commands/setup.js#L516-L522
if (info && info.versions) {
  for (var i = 0, vers = info.versions, l = vers.length; i < l; i++) {
    if (appc.version.gt(vers[i], r.npm.latest)) {
      r.npm.latest = vers[i];
    }
  }
}

Proposed chage

The above lines with:
if (info && info.version) {
  r.npm.latest = info.version;
}

Comments

  1. Radamantis Torres-Lechuga 2015-04-06

    [~fokkezb] is this still an issue?
  2. Fokke Zandbergen 2015-04-07

    [~rtlechuga] yes: ti setup > check
         *  npm                new version v2.7.6 available! (currently v1.4.28)
       
    npm info npm
         version: '2.7.5',
       
  3. Chris Barber 2015-09-08

    Verified this is a bug. @fokke is correct, we should be looking at version, not versions, then showing the proper label based on whether they are up-to-date, behind, or bleeding edge. This is pretty low priority as this is just a report screen. Titanium CLI doesn't really do anything meaningful with NPM post installation.
  4. Fokke Zandbergen 2015-09-09

    Well, low prio except for that it now kind of suggests to upgrade to a new version we don't support:
       Node.js
         ★  node               new version v4.0.0 available! (currently v0.10.40)
         ★  npm                new version v3.3.2 available! (currently v1.4.28)
       
    We might want to use [vendorDependencies](https://github.com/appcelerator/titanium_mobile/blob/master/package.json#L63) to determine what we show here.
  5. Chris Barber 2015-09-09

    Um, and how exactly do we "not support" NPM v3.3.2 or any other specific version? What compatibility issues are there? You see, once Titanium is installed, it doesn't care about NPM. It's never invoked. This screen is just a report. Titanium CLI doesn't have "vendorDependencies". That's a TiSDK thing and Titanium SDK doesn't reference NPM either. So, all this ticket needs to do is report the latest stable.
  6. Chris Barber 2015-09-09

    PR: https://github.com/appcelerator/titanium/pull/232
  7. Fokke Zandbergen 2015-09-11

    What I mean is node v4.0.0 that we don't (yet) support. Since I think the message suggest people to upgrade to the latest, even now we've fixed that to be the latest stable that might mean they upgrade to a version we don't support yet.
  8. Chris Barber 2015-09-11

    I see your point. I'm fine with ripping Node.js and NPM out of "ti setup check". The intent is if someone has issues with their system, they can copy/paste the results of "ti setup check" and that would help us help them.
  9. Ingo Muschenetz 2015-09-11

    I'd be fine leaving it in but only showing what you have and not encouraging an upgrade
  10. Chris Barber 2015-09-11

    That works too.
  11. Chris Barber 2015-09-11

    PR 2: https://github.com/appcelerator/titanium/pull/233
  12. Harry Bryant 2015-09-17

    Verified fixed, running " ti setup " and selecting " check " displays versions without encouraging updates. Ti.SDK: 5.0.0.v20150915230722 Appc Studio: 4.3.0.201509140942 Appc CLI: 5.0.0

JSON Source