Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13607] NPM: version downloaded may not the correct one, but reports accurate version

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2016-08-29T21:59:44.000+0000
Affected Version/sRelease 3.1.0
Fix Version/sn/a
ComponentsCLI
Labelsqe-3.1.1
ReporterFederico Casali
AssigneeEric Merriman
Created2013-04-17T20:52:52.000+0000
Updated2017-03-24T21:57:44.000+0000

Description

Problem description

After updating to 3.1.0 (Alloy 1.1.0), I found out that my Alloy installed version was not reflecting the displayed version number and was not the 1.1.0 correct one, but a previous one. 'alloy -v' command was displaying the correct version (1.1.0) but the code in '/usr/local/lib/node_modules/alloy/Alloy/commands/compile/index.js' @lines 330 to 343 was wrong, not reflecting changes made for 1.1.0. Cleaning npm cache (sudo npm cache clean) fixed the issue and I was able to install the correct Alloy 1.1.0 version using 'sudo npm install -g alloy' command.

Note

The code from in '/usr/local/lib/node_modules/alloy/Alloy/commands/compile/index.js' @lines 330 to 343 should be:
// Load the style and update the state
		if (files.STYLE) {
			var theStyles = _.isArray(files.STYLE) ? files.STYLE : [{file:files.STYLE}];
			_.each(theStyles, function(style) {
				if (fs.existsSync(style.file)) {
					logger.info('  style:      "' + 
						path.relative(path.join(dir,CONST.DIR.STYLE),style.file) + '"');
					state.styles = CU.loadAndSortStyle(style.file, manifest, {
						existingStyle: state.styles,
						platform: style.platform
					});
				}
			});
		}

Comments

  1. Eric Merriman 2013-04-17

    We are seeing this on Olga's machine. Not currently seeing this on mine. Her steps: 1) "sudo uninstall -g alloy" 2) Studio launch, prompt for install of alloy 3) Install alloy 4) "alloy -v" gets you 1.1.0 Code snippet shown above not present on her machine. It is accurate on mine.
  2. Ingo Muschenetz 2013-10-08

    Deferring for now as there appears to be a workaround. Likely this is a Node.js/NPM bug.
  3. Chris Barber 2016-08-29

    I tested this with NPM 3 and the globally installed Alloy and everything worked as expected. This sounds like a bug in NPM. Neither here nor there, this is pretty a non-issue with the Appc CLI and will certainly be a non-issue after we roll out the new build pipeline.
  4. Lee Morris 2017-03-24

    Closing ticket as the issue cannot be reproduced and with reference to the previous comments.

JSON Source