How to Execute a Shell Script in NodeJS 2022-10-25 31 words - 1 min read If you need to execute a shell script in NodeJS, then you can use the exec keyword. Syntax: exec(command [, options] [, callback] 1 2 const shell = require('shelljs') shell.exec("npm --version")