IDEA unable to run JavaScript script using NodeJs on Ubuntu

IntelliJ IDEA tries to run following command.

/usr/sbin/node --debug-brk=39773 --nolazy calculate.js

It fails because "node" is not "nodejs" on Ubuntu.
How do I make it work?

  1. In IDEA go to Run->Edit Configurations.
  2. Change "Node interpreter" field to "/usr/bin/nodejs".