For most programs, running them from the command-line opens up more freedom and control, as you can enter any program parameters and files and selectors there easily. You can use pipes to establish a flow of data. Just as an example, with command line, you can easily execute all JS files in a directory which have "test" in their name:
$ ls /path/to/files |grep -i test |node
Compared to that, running the program via an icon just executes one pre-defined command (which you can change any time, btw). Other than that, the program should behave in exactly the same way. The behavior you describe probably stems from a difference in parameters or you used a different user to execute the program from command line.