I am trying to run a function by calling a npm script with an additional parameter that would provide a path to a specific file. In a simplified version it looks sort of like that:
package.json
"reset_script": "node -e 'require("./script_reset_db").resetDatabase($npm_config_path)'"
script_reset_db.js
module.exports.resetDatabase = async (path) => { console.log(path) }
In a node terminal I’m executing:
npm run reset_script –path=123
But the command results in an error:
at [eval]:1:44
at Script.runInThisContext (node:vm:129:12)
at Object.runInThisContext (node:vm:305:38)
at node:internal/process/execution:81:19
at [eval]-wrapper:6:22
at evalScript (node:internal/process/execution:80:60)
at node:internal/main/eval_string:27:3
Do you have any idea what could be the issue?