Could someone explain what “process.argv” means in node.js please?

Do a quick console.log(process.argv) and you’ll immediately spot the problem.

It starts on 2 because process.argv contains the whole command-line invocation:

process.argv = ['node', 'yourscript.js', ...]

Elements 0 and 1 are not “arguments” from the script’s point of view, but they are for the shell that invoked the script.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)