‘env: node: No such file or directory’ Error in IntelliJ IDEA File Watcher

I was getting the following error when using the File Watcher feature in IntelliJ Idea to compile Typescript files:

/usr/local/bin/tsc –verbose –sourcemap test.ts
env: node: No such file or directory

The solution is relatively simple, you need to manually set the PATH environment variable in the File Watcher like so:

PATH variable in Idea File Watcher

 

You can get your environment’s PATH variable from ~/.MacOSX/environment.plist if you’re rocking a Mac. Alternatively you can probably use this one (again for a Mac):

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin

8 comments

Thomas Burleson

I wanted to use WebStormIDE to launch a NodeJS Http-Proxy server (written in Coffeescript).
Your tip SAVED the day for me…

Thank you very much.

Thanks.
Your tip is working fine with WebStorm 8

Thanks a lot.

Works for Webstorm 9 for jade file watcher.

Thank you! This worked for Webstorm 11 with Babel file watcher (compilation of ES5 to ES6).

Same started happening randomly after working fine with the LESS Compiler too. This fix works with PHPStorm 8.0.3. Don’t know why it ever started occurring though.
Tip: to get the contents of your PATH variable, go to a terminal and type:

echo $PATH

Andrew Wooldridge

This helped me with another related issue. Trying to run gulp tasks in our project resulted in the same error. Adding the PATH env fixed it.

Works perfectly for me. Using IntelliJ File watcher to convert Jade to HTML

Leave a Reply