You got this error because the commands are not supported in your Jenkins node. Let's discuss this with an example.
Say, you have created one Jenkins Cluster. This cluster has three nodes, two Linux system and one windows system. Now create one job and try to run ls command. When this job runs on Linux system, it will work fine. But if this job runs on windows system, then it will give an error, because windows does not support ls command.
To avoid this error we can create labels in our nodes and then run Jenkins job accordingly.
Hope this will help.