# Execute java script file from node red

**URL:** <https://discourse.nodered.org/t/execute-java-script-file-from-node-red/21313>\
**Category:** General\
**Created:** [5 February 2020 14:18 UTC](https://discourse.nodered.org/t/execute-java-script-file-from-node-red/21313 "2020-02-05T14:18:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![akhtar321h](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@akhtar321h](https://discourse.nodered.org/u/akhtar321h)\
**Post date:** [5 February 2020 14:18 UTC](https://discourse.nodered.org/t/execute-java-script-file-from-node-red/21313/1 "2020-02-05T14:18:28Z")

</div>

I want to execute a java script file from node red.  
how can i execute the file from node red.  
Please help me out for executing the file from node red.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [5 February 2020 14:19 UTC](https://discourse.nodered.org/t/execute-java-script-file-from-node-red/21313/2 "2020-02-05T14:19:55Z")

</div>

Look at the Exec node - it can be used to run any command you want.

---

<div class="post-metadata">

**Author:** ![akhtar321h](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@akhtar321h](https://discourse.nodered.org/u/akhtar321h)\
**Post date:** [5 February 2020 14:24 UTC](https://discourse.nodered.org/t/execute-java-script-file-from-node-red/21313/3 "2020-02-05T14:24:22Z")

</div>

I tried with that, but it is not executing.  
I have one file i.e., App.js, and the file path is C:\Users\abc\Desktop\>node App.js  
so, how can i give the command in Exec node, and what is the command, I have to pass.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [5 February 2020 15:22 UTC](https://discourse.nodered.org/t/execute-java-script-file-from-node-red/21313/4 "2020-02-05T15:22:26Z")

</div>

You will need to give the Exec node the full path to the `node` command you want it to run as well as the full path to the `.js` file.

Why are you trying to run a javascript file from Node-RED? Is this related to your redis questions in the other thread?

---

<div class="post-metadata">

**Author:** ![akhtar321h](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@akhtar321h](https://discourse.nodered.org/u/akhtar321h)\
**Post date:** [6 February 2020 04:31 UTC](https://discourse.nodered.org/t/execute-java-script-file-from-node-red/21313/5 "2020-02-06T04:31:06Z")

</div>

Yes, it is related to redis.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [6 April 2020 04:31 UTC](https://discourse.nodered.org/t/execute-java-script-file-from-node-red/21313/6 "2020-04-06T04:31:10Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
