sublime-ti-build icon indicating copy to clipboard operation
sublime-ti-build copied to clipboard

How does this work?

Open samholmes opened this issue 12 years ago • 15 comments

Very little explanation as to how to use this plugin, so I'm unsure as to if I'm doing something incorrectly. I drop the folder that titanium create created into my sublime project (unsaved projected FYI), and then I run Cmd+B making sure that Titanium is the build system selected. All I get is something like: env: node: No such file or directory [Finished in 0.0s with exit code 127] output into the console.

How is this plugin suppose to work?

I'm running OS X ML, Sublime Text 2 and Titanium 3.x installed from Studio.

samholmes avatar Apr 27 '13 00:04 samholmes

I keep getting this error when running this plugin and choosing ios > simulator > iphone

env: node: No such file or directory

I'm not sure what's wrong.

samholmes avatar Apr 27 '13 00:04 samholmes

I've had to open Sublime from the terminal for certain commands due to the way paths are setup. I use subl . to launch sublime for the current directory.

http://www.sublimetext.com/docs/2/osx_command_line.html

MattTuttle avatar Apr 29 '13 13:04 MattTuttle

Are there plans for fixing this? What is the issue with paths when not opening from command line?

samholmes avatar Apr 29 '13 17:04 samholmes

I encountered exactly the same problem with this - in the end I fixed it by creating an alias for sublime - eg: in terminal:

alias sublime="open -a /Applications/Sublime\ Text\ 2.app" 

and using this to open Sublime then the build process will work. I found the details here: https://gist.github.com/artero/1236170 and the simpler approach I used above was suggested in the comments

linearshift avatar May 06 '13 11:05 linearshift

I can confirm this issue.

oskarhane avatar May 10 '13 20:05 oskarhane

I don't want to keep opening my terminal just to open sublime-text. Is there anyway to fix this? What is the issue with the paths when not opening from command line?

samholmes avatar May 11 '13 05:05 samholmes

Try using something like launchctl setenv PATH $PATH to set your environment variables on OSX. I just found out about this the other day so hopefully it helps. There may be other environment variables for Node that I'm not aware of.

MattTuttle avatar May 20 '13 19:05 MattTuttle

I can confirm. Any other help? Very excited to use.

zweiland-zz avatar May 31 '13 17:05 zweiland-zz

I'm not understanding the problem here. Could someone explain to me what's going on behind the scens with ST and why it works when launching ST from terminal using subl and why it doesn't work when launching from the app icon?

samholmes avatar Jun 27 '13 07:06 samholmes

OSX is weird in that the paths set in the terminal are different than the ones use for visual apps. NodeJS is usually the reason it fails because OSX can't find it on the visual app PATH. By default it uses /usr/local/bin which is not included by default in OSX apps.

Apple has some information here on how you can setup an environment variables file in ~/.MacOSX/environment.plist. https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html

MattTuttle avatar Jun 27 '13 21:06 MattTuttle

Oddly, ~/.MacOSX is not a directory on my machine.

None of the solutions work. I tried using launchctl to set the PATH environment variable, which it looks like it (launchctl getenv PATH tells me so), but opening ST and running the build commands still gives me the same error as above. I tried editing /etc/launchd.conf with the PATH I want and restarted my machine, and yet that doesn't work. The plist option I can't do cause I don't have the .MacOSX dir in my home dir. Also, I've read that configuring this plist wont work for apps opened in Spotlight.

The only thing that works is subl . as mentioned. I guess I'll just have to use this when starting my Titanium development for now.

samholmes avatar Jun 27 '13 22:06 samholmes

Same here, is this going to get fixed?

stevoPerisic avatar Jul 22 '13 19:07 stevoPerisic

Do the following before starting Sublime Text:

export NODE=/usr/local/bin/node

asiby avatar Aug 03 '13 05:08 asiby

just create a symbol link of node to /usr/bin

    sudo ln -s /usr/local/bin/node /usr/bin/node´

It'll work properly.

yomybaby avatar Oct 04 '13 22:10 yomybaby

thanks @yomybaby ! :)

philsmithsonuk avatar Dec 05 '13 04:12 philsmithsonuk