Nodejs uses the shelljs module’s exec method to execute shell script commands, but it will be executed many times. I don’t know why

  node.js, question

Nodejs uses the shelljs module’s exec method to execute shell script commands, but it will be executed many times. I don’t know why. The code is simple, as follows

Start file:

#!  /usr/bin/env node
 
 var shelljs = require('shelljs/global');
 exec('node --version');

Start is executed, and the terminal displays:

v0.10.29
 v0.10.29
 v0.10.29
 v0.10.29
 v0.10.29
 v0.10.29
 v0.10.29
 v0.10.29
 v0.10.29
 v0.10.29
 v0.10.29

Sometimes it’s only shown once, sometimes it’s two lines, it’s also 3, 4, 5, 6… n lines, sometimes it’s not executed. so why

It was unloaded and loaded again.