Portland ME - Had a tough time getting the newest Titanium Studio 3.4.1 installed today. I was receiving errors when the studio first loaded concerning "java.lang.nullpointerexception". When I tried to create a new project, more errors occured referencing "longjohn/dist/longjohn.js:185" and "TypeError: Object # has no method 'each' at CLI.emit" which prevented the project from being fully created. Also, when working form the command line I received the same errors. After much googling and not finding a good answer, I found a partial suggestion that worked. I rolled the Titanium SDK back to a different version with this command:
$ ti sdk install --branch 3_3_X
Once that installed, I was able to use titanium form the command line with no problem. Please note that before this, I also did everything most forum posts suggested, including uninstalling the titanium node package, uninstalling nodejs and then following the step by step guide Appcelerator has here http://docs.appcelerator.com/titanium/3.0/#!/guide/Quick_Start. At that point it still didnt work, however I think I was working with a fairly clean set up.
Once I could use titanium from the command line, I use the setup script there to finish my install. I think it helped everything apply without the GUI interfering.
$ titanium setup
The last issue I had to overcome was Titanium complaining about not finding the Android SDK. I installed it via the program GUI 5+ times and it never took. I also manually entered the path to the sdk in the command line setup tool. I even made sure the path to the SDK was included in the $PATH variable. Nothing worked, until I realized that the install package that Titanium gets and the one you get from https://developer.android.com/sdk/index.html if you dont choose "GET THE SDK FOR AN EXISTING IDE" comtains an empty /packages directory! If you download the Eclipse ADT the sdk directory contains everything that is needed. I jumped back on the command line set up tool and told Titanium where to find the new Android SDK directory. Then I ran the Check Envirnoment function in the setup script and it successfully found the Android SDK.
Hopefully this helps!