[TIMOB-19470] CLI: ti setup doesn't properly select last available versions from npm
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-09-09T16:13:06.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 5.0.0 |
Components | Tooling |
Labels | setup |
Reporter | Fokke Zandbergen |
Assignee | Chris Barber |
Created | 2014-10-29T09:09:59.000+0000 |
Updated | 2015-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;
}
[~fokkezb] is this still an issue?
[~rtlechuga] yes:
ti setup
> checknpm info npm
Verified this is a bug. @fokke is correct, we should be looking at
version
, notversions
, 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.Well, low prio except for that it now kind of suggests to upgrade to a new version we don't support:
We might want to use [vendorDependencies](https://github.com/appcelerator/titanium_mobile/blob/master/package.json#L63) to determine what we show here.
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.
PR: https://github.com/appcelerator/titanium/pull/232
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.
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.
I'd be fine leaving it in but only showing what you have and not encouraging an upgrade
That works too.
PR 2: https://github.com/appcelerator/titanium/pull/233
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