I see that you are trying to use ls command, which does not exist on Windows, that is why you see the error.
What I would suggest you is to rely on fs module if you just want to list the content of the current directory. In general, you should avoid running CLI utilities if there is a native API that is available to you.
You can use fs.readDir function to replace ls.