Rund NodeJS file in shellscript loop

My shellscript looks like

for i in {1..5}
    do
        echo "Welcome $i times"
        exec node nodefile.js
done

and the nodefile.js looks like

console.log 'running nodefile'

When I call the ./shellscript.sh there will only be displayed "Welcome x times" and "running nodefile" once.

Whats missing there? Is there anything that I have to return in nodefile or something else?

Try this

for i in {1..5}
do
   echo "Welcome $i times"
   node process.js
done

As an alternative you might try using the 'sha-bang' method.

Put this in your nodefile.js:

#!/the/location/of/your/node
console.log("running nodefile");

Then make the nodefile.js executable by doing:

chmod +x nodefile.js

Now your shell script can look something like this:

for i in {1..5}
do
   echo "Welcome $i times"
   /location/of/nodefile.js
done