'Error: Unknown or unexpected option: --logError

I am trying to run a script:

"dev": "yarn postinstall && nodemon --ignore 'src/**/*.spec.ts' --exec ts-node --logError --files src/index.ts" with yarn dev

but it throws this error:

/project_path/node_modules/arg/index.js:90
                              throw err;
                              ^

Error: Unknown or unexpected option: --logError
    at arg (/project_path/node_modules/arg/index.js:88:19)
    at Object.<anonymous> (/project_path/node_modules/ts-node/dist/bin.js:13:14)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'ARG_UNKNOWN_OPTION'
}

ts-node version 10.8.0

I verified if the option exists with ts-node -h and it definitely exists

Usage: ts-node [options] [ -e script | script.ts ] [arguments]

Options:

.
.
.
  --logError           Logs TypeScript errors to stderr instead of throwing exceptions
.
.
.

What is the cause of this problem and how can I resolve it ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source