Closed NoriSte closed 4 years ago
Thank you for your report.
But that's not a bug in npm-run-all
.
The cause is that you set $npm_execpath
environment variable with an invalid value. The $npm_execpath
must be a valid path to npm
or a compatibility tool. But the npm.run()
function seems to set require.main.filename
to the environment variable. In your case, that value is not an npm compatibility tool.
Hi @mysticatea Thank you so much for the feedback! I'm trying to find a feasible path to solve the problem but I think I can't do anything to solve that 😕
$npm_execpath
during the npm.run()
execution, so I can't set it just before it runs the npm-run-all
-based commandnpm-run-all
accepts an npmPath
option. I could add it if I detect that the script body contains npm-run-all
, run-s
, etc. but I can't identify it in a subsequent commandDo you have more suggestions about how I can handle the problem? Thank you so much Stefano
I think that you should open an issue at https://github.com/npm/npm-lifecycle.
Hi I found a bug while launching an
npn-run-all
-based script withnpm.run()
. You can watch the bug opening this example on CodeSandbox or play with the repo that I shared.The issue is: if I have a
"run:examples:s": "npm-run-all -s example:**"
script in my package.json file and if I leverage the native
npm.run("run:examples:s")
API to run a script (instead of the standard$ npm run run:examples:s
)npm-run-all goes to an infinite loop.
I hope it's clear, let me know if you need me to explain it better.
Anyway: thank you so much for the amazing library 😊 Thank you Stefano