Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Titanium CLI 3.2 doesn't work on Ubuntu because it doesn't strip the node executable from the args

$
0
0

The Titanium CLI 3.2.0 doesn't run any commands I enter on Ubuntu 13.10.

When running the Titanium CLI without any arguments, I get a message:

Titanium Command-Line Interface, CLI version 3.2.0, Titanium SDK version 3.2.0.GA Copyright (c) 2012-2013, Appcelerator, Inc. All Rights Reserved.

Please report bugs to http://jira.appcelerator.org/

[ERROR] "/usr/bin/titanium" is an unrecognized command.

Run 'nodejs help' for available commands.

I traced it down to these lines in cli.js

// strip the node executable from the args
var args = this.argv.$_;
if (args[0].replace(/\\/g, '/').split('/').pop().replace(/\.exe$/, '') == process.execPath.replace(/\\/g, '/').split('/').pop().replace(/\.exe$/, '')) {
    args.shift();
}

The if returns false because args[0] is node, but process.execPath is /usr/bin/nodejs under Ubuntu.

Because of a naming conflict with an older package (see Node Ubuntu notes), the node executable in Ubuntu is called nodejs. /usr/bin/node is symlinked to /usr/bin/nodejs

I currently work around the issue by removing the extra 'js' at the end of the executable name with the following change to cli.js:

if (args[0].replace(/\\/g, '/').replace(/js$/,'').split('/').pop().replace(/\.exe$/, '') == proce~ss.execPath.replace(/\\/g, '/').replace(/js$/,'').split('/').pop().replace(/\.exe$/, '')) {

I can create a JIRA ticket with this info.


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>