Intellij can not determine node with gradle

Answered

I have an issue with my intellij 15, i can't run my project with run / debug button. I got this error bellow:

:grunt_test FAILED
Execution of grunt_test took 0.034 secs

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':grunt_test'.
> A problem occurred starting process 'command 'node''

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 14.721 secs
error=2, No such file or directory
09:48:34: External task execution finished 'bootRun'.

it was working well before i upgrade my OS Yosmite to El Capitan. However when i execute "gradle bootRun" in terminal it work well.

Thank you in advance.

3 comments
Comment actions Permalink

Setting environment on Mac is tricky and depends on OS version. IntelliJ IDEA environment variables are different from what you have in Terminal, hence the problem.

See the following questions:

http://apple.stackexchange.com/q/51677

http://apple.stackexchange.com/q/57385/17551

http://stackoverflow.com/q/135688/104891

0
Comment actions Permalink

The problem is specific to Gradle IDEA implementation - it uses System.getenv() to get environment, which doesn't return correct environment on Mac unless IDEA is started from terminal.
Please vote for https://youtrack.jetbrains.com/issue/IDEA-127993 to be notified on any progress.
For now you have to either run IDEA from terminal or use Grunt run configuration to execute Grunt tasks instead of using Gradle build

0
Comment actions Permalink

No, Gradle IDEA doesn't use System.getenv() to get environment, it even doesn't start the process(gradle daemon) by itself.

Gradle IDEA implementation uses Gradle Tooling API to integrate with Gradle.

Yoiu can see some details at https://discuss.gradle.org/t/is-it-possible-to-set-os-environment-parameters-via-the-tooling-api/3423

And feel free to vote for https://issues.gradle.org/browse/GRADLE-2525

 

0

Please sign in to leave a comment.