{ "id": "122831", "key": "TIMOB-15804", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "15817", "description": "2014 Sprint 01", "name": "2014 Sprint 01", "archived": true, "released": true, "releaseDate": "2014-01-17" }, { "id": "15819", "description": "2014 Sprint 01 Core", "name": "2014 Sprint 01 Core", "archived": true, "released": true, "releaseDate": "2014-01-17" }, { "id": "15856", "description": "Release 3.2.1", "name": "Release 3.2.1", "archived": false, "released": true, "releaseDate": "2014-02-10" }, { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-01-17T00:35:19.000+0000", "created": "2013-11-23T01:21:37.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [ { "id": "34045", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "123614", "key": "AC-2065", "fields": { "summary": "titanium cli wans't shifting argv right", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "34696", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "125357", "key": "AC-2035", "fields": { "summary": "errors appearing when building a project", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2014-01-31T04:35:26.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "13103", "name": "CLI", "description": "Node-based command line interface" } ], "description": "On Ubuntu, we found that if node.js is installed via some sort of Debian package, that installs node.js as {{/usr/bin/nodejs}}. {{/usr/bin/node}} is a symlink to {{/etc/alternatives/node}} which is also a symlink to {{/usr/bin/nodejs}}.\r\n\r\nThe problem is {{process.args\\[0\\]}} is \"node\", but {{process.execPath}} is \"/usr/bin/nodejs\". The CLI compares these two to detect if the first arg is the node.js executable, then strip it off. Because \"node\" != \"nodejs\", the executable is not stripped off and the error happens.\r\n\r\n{code}\r\n[ERROR] \"/usr/bin/titanium\" is an unrecognized command.\r\n{code}\r\n\r\nor\r\n\r\n{code}\r\n[ERROR] \"/usr/local/bin/titanium\" is an unrecognized command.\r\n{code}\r\n\r\nTo fix this, we need to properly resolve {{process.args\\[0\\]}}. That means that the CLI needs to call {{appc.subprocess.findExecutable(process.argv\\[0\\], ...)}} to convert \"node\" to \"/usr/bin/node\", then we need to run {{fs.realpathSync()}} on that result to resolve the symlinks to \"/usr/bin/nodejs\" and finally compare that to {{process.execPath}}.\r\n\r\nh4. Workaround\r\n\r\nAs a temporary workaround, you can copy /usr/bin/nodejs to /usr/bin/node.", "attachment": [], "flagged": false, "summary": "CLI: All commands fail if \"node\" executable is not actually called \"node\"", "creator": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "environment": "Ubuntu 12.04 (64-bit)\r\nNode.js 0.10.21", "comment": { "comments": [ { "id": "285628", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Here's a Q&A question right after the 3.2 release: http://developer.appcelerator.com/question/160741/titanium-cli-32-doesnt-work-on-ubuntu-because-it-doesnt-strip-the-node-executable-from-the-args.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2013-12-23T10:21:55.000+0000", "updated": "2013-12-23T10:21:55.000+0000" }, { "id": "285874", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Here's a Github issue also relating to this problem: https://github.com/appcelerator/titanium/issues/86", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2013-12-26T18:17:42.000+0000", "updated": "2013-12-26T18:17:42.000+0000" }, { "id": "287059", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Master pull request: https://github.com/appcelerator/titanium/pull/88\n3.2.x pull request: https://github.com/appcelerator/titanium/pull/89", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2014-01-07T21:48:45.000+0000", "updated": "2014-01-07T21:48:45.000+0000" }, { "id": "288329", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Here's another Q&A question related to this issue: http://developer.appcelerator.com/question/161405/unable-to-create-new-project---run-node-help-for-available-commands", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2014-01-15T20:10:42.000+0000", "updated": "2014-01-15T20:10:42.000+0000" }, { "id": "289164", "author": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed on:\nUbuntu 12.04 LTS\nTitanium CLI: 3.2.1 (git://github.com/appcelerator/titanium.git#3_2_X)\nTitanium SDK, build: 3.2.1.v20140121132444\nNPM: 1.3.21\nNode: 0.10.24\n\nCLI: 3.2.0 did not recognize titanium command and threw error displayed in description\nCLI: 3.2.1 correctly recognizes the titanium command and works as expected\nClosing.", "updateAuthor": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-22T00:16:41.000+0000", "updated": "2014-01-22T00:16:41.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }