简体   繁体   中英

Using Bash as eclipse external tools with node.js in Ubuntu 14.04

OS = Ubuntu 14.04 I've been trying to add node.js as eclipse external tools after reading this article which is based on Windows. So i am trying to apply it to Ubuntu 14.04 using bash shell, and it keeps giving me an error.

Here is the image of my setting.

在此处输入图片说明

And when i run JavaScript code with that, i get this error message on my eclipse console

/bin/bash: eval: No such file or directory

But when i tried with emulating terminal(both with eval and without eval), it execute JS code well.

demo1.js just have one line of code console.log("TEST"); and i get these results.

owner@pcowner:~/workspace/javascriptDemo$ nodejs demo1.js
TEST
owner@pcowner:~/workspace/javascriptDemo$ eval nodejs demo1.js
TEST

What should i do?

In a terminal run which nodejs and note the path (ie /usr/bin/nodejs). Back in your External Tools Configuration in Eclipse, enter that path for Location .

Working Directory remains ${project_loc}

Arguments can be ${resource_name} or demo1.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM