-
-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why do postinstall scripts exit with code 0 on failure? #442
Comments
as an note, you were looking at outdated files (but the point still stands):
this is currently to not block the install of the packages (might be counter intuitive) @nodkz do you think we should actually fail in the postinstall? (aside from "skip" & "systembinary") |
Motivation:
We can add a new option for package.json or env variable e.g @mhassan1 @hasezoey how do you think this option/env can be named? Is |
Personally, I think the default behavior should be to fail, with an option like I think something like |
isnt and when implementing |
Good point. There's not much of a difference between |
actually, when implementing a way to not fail with code 0, we could maybe add an test that creates an temporary directory and an basic package.json and try to install everything (with local linking install) |
Versions
package: mongodb-memory-server
What is your question?
In the
postinstall
script inmongodb-memory-server
, there are a few failure conditions that result in an exit code of 0, for example:I see related discussion here: #131
IMO, the postinstall should not exit with code 0 when the script fails to do what the consumer expects. Presumably, consumers are using the
mongodb-memory-server
package because they want thepostinstall
step to happen; if they didn't care about that, then they would usemongodb-memory-server-core
, instead. If thepostinstall
fails, they should be notified with a non-zero exit code; if they don't like that behavior, they can opt for thecore
package, or we can offer them another way to opt out of that behavior.What was the reasoning behind exiting with code 0 for failure cases?
The text was updated successfully, but these errors were encountered: