How to print output and change directory in Execute Command node on Windows

Hi,

I am working on a workflow starting by an Execute commande node.

cd "my/working/directory/target"
node honestly_my_awesome_script.js

My script generate a json file I will load on next node.

Currently, it’s not working. And I don’t understand the reason.

Is there a way to print the output ?
Does the cd command change the working directory of the node ?

Thank you
Best

Information on your n8n setup

  • n8n version: Not sure how to find it on Windows
  • Database you’re using (default: SQLite): Not sure how to find it on Windows
  • Running n8n with the execution process [own(default), main]: Default
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: Windows app

Hey @JulienDelRio,

That should work and some output should be there depending on what the console returns. It could be that the path is not correct I suspect it would need to include the drive letter as well unless you use /Users/juliendelrio/desktop/ or similar.

Hi Jon,

I maybe found the bug.

cd "C:\Users\myusername\myawesomepath" && node myawesomescript.js is working

cd "C:\Users\myusername\myawesomepath"
node myawesomescript.js

Is not working

Maybe a bug on the windows client ?