Starting IDE with $PATH in Mac OS X 10.8+

I have ran into the problem recently. We have a complex build process, including npm install task at my current project. The project hierarchy and build is handled by maven.

The problem is that when I run the build from the IntelliJ IDEA, it fails with the following error message:

An Ant BuildException has occured: Execute failed: Cannot run program "npm": error=2, No such file or directory -> [Help 1]  

This error message apparently states, that there are no executable found. Hence, the $PATH is incorrect.

I've found the solution :)

First: make sure that /usr/local/bin is in the $PATH variable!

Second: have a look at this answer at and create the file following the example.

Simply follow this two steps FTW!

P.S. Also, see this for additional insight:

Have a nice NodeJS hacking!