опция командной строки --check
должна проверять (на наличие ошибок) файл, не выполняя его, но он не работает.
Он работал один или два раза, но сейчас это не так, я пропускаю что-то или это не правильный синтаксис может быть?
ИСПЫТАНО на windows 10 / PowerShell (с правами администратора)
--- PowerShell command line
$ > node --check index.js // doesn't do anything (no error thrown)
$ > node -c index.js // doesn't do anything (no error thrown)
$ > node index.js --check // executes the file (prints 'module executed!' and throws a ReferenceError)
$ > node index.js -c // executes the file (prints 'module executed!' and throws a ReferenceError)
--- index.js file
console.log( 'module executed!' );
myRefferenceError; // ReferenceError