env: node: No such file or directory when setting up External Tool

So I installed a tool globally via 'npm install beautify -g' The docs on the tool indicate a simple usage of 'beautify -o <output_file> <input_file>'

So I create an external tool whose PROGRAM is '/usr/local/bin/beautify' (I have confirmed this file exists, though it is a symlink to '/usr/local/lib/node_modules/beautify/bin/beautify.js') I have confirmed that from the Terminal I can type 'beautify' and Terminal finds it, and can confirm that '/usr/local/bin' is in my $PATH.

For PARAMETERS I've foregone using macros for the moment and just put: '-o ./sample/test.beautified.css ./sample/test.css' (I can confirm that from my project root, there IS a '/sample/test.css' file)

For WORKING DIRECTORY I used the macro: $ProjectFileDir$ which shows me as '/Users/<username>/Web/sites/<project_folder>'

However, when I right click a file in the PROJECT WINDOW and run the External tool on the file, my "RUN" window opens with an error:

'/usr/local/bin/beautify -o ./sample/test.beautified.css ./sample/test.css
env: node: No such file or directory

Process finished with exit code 127'

I took the first line and pasted it into a Terminal that was sitting at my project root and BOOM, the file was processed and it created the '/sample/test.beautified.css' file as expected. I can confirm that I setup my Node interpreter and enabled the Node.js Core Library as well. It shows me using 7.4.0 (which is correct), and shows 'beautify 0.0.8' installed and '0.0.8' as the latest.



What if you use "/usr/local/lib/node_modules/beautify/bin/beautify.js" instead of "/usr/local/bin/beautify" there?


Hey Dmitry, thanks for responding. When updated, I get:

/usr/local/lib/node_modules/beautify/bin/beautify.js -o ./sample/test.beautified.css ./sample/test.css
env: node: No such file or directory

Process finished with exit code 127


I am using the macro $ProjectFileDir$ for the WORKING DIRECTORY. There is a folder called 'sample' and there is a file in it called 'test.css'


Please sign in to leave a comment.