Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1200] Arguments to path.join must be strings

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2015-07-02T18:28:35.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAlloy, Titanium SDK & CLI
Labelsn/a
ReporterFix Please
AssigneeRadamantis Torres-Lechuga
Created2015-06-09T10:10:48.000+0000
Updated2016-03-08T07:37:34.000+0000

Description

Alloy projects can't be compiled anymore after the latest update. TS gives the following error:
[ERROR] Application Installer abnormal process termination. Process exit value was 8

C:\Users\Francois\AppData\Roaming\npm\node_modules\titanium\node_modules\longjohn\dist\longjohn.js:185
        throw e;
              ^
TypeError: Arguments to path.join must be strings
    at f (path.js:204:15)
    at filter (native)
    at exports.join (path.js:209:40)
    at D:\Titanium_Studio_Workspace\test123\plugins\ti.alloy\hooks\alloy.js:105:15
The bug is added by the latest update:
	if (paths[bin]) {
		done();
	} else if (process.platform === 'win32' && bin === 'alloy') { // HERE !!!
		paths.alloy = 'alloy.cmd';
		done();
	} else {
		exec('which ' + bin, function (err, stdout, strerr) {
			if (!err) {
				paths[bin] = stdout.trim();
				done();
			} else {
				parallel(this, [
					'/usr/local/bin/' + bin,
					'/opt/local/bin/' + bin,
					path.join(process.env.HOME, 'local/bin', bin),
The (bin === 'alloy') condition is added. As the result execution goes to the 'else' branch and crash on the path.join as there is no process.env.HOME is usually set in the windows environment. Could you please fix that. Or better, rewrite the whole 'run' function as the code is not perfect. Thanks

Comments

  1. Radamantis Torres-Lechuga 2015-06-09

    [~fixplease] is something that we can replicate with a vanilla Alloy app? if not, you mins attaching a test case that replicates the issue? Thanks
  2. Fix Please 2015-06-09

    I used just newly created Alloy app (File->New->Mobile App Project->Alloy->Default Alloy Project). However, it's clear that the code above is buggy. No? See the ..\AppData\Roaming\npm\node_modules\alloy\hooks\alloy.js around lines ##90-100
  3. Radamantis Torres-Lechuga 2015-07-02

  4. Radamantis Torres-Lechuga 2015-07-02

JSON Source