we use different file discriptors like, 2> , 2>&1 etc ... to capture stdout, stderr, but how to generate or print stderr. I was working with some nodejs project and i need to some msg as an error, but my bash script on the server prints msg as stdout which is why node js can't print, so i have to print my msg as stderr.

let's see how to do it using these discrptors.
>&2 echo ‘my message'
i put ">&2" infront of my message which i want to print as stderr. So it worked for me.