[AC-1200] Arguments to path.join must be strings
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2015-07-02T18:28:35.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Alloy, Titanium SDK & CLI |
Labels | n/a |
Reporter | Fix Please |
Assignee | Radamantis Torres-Lechuga |
Created | 2015-06-09T10:10:48.000+0000 |
Updated | 2016-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
[~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
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