Skip to content

optionalDependencies is really wonky #2737

substack opened this Issue Aug 20, 2012 · 1 comment

2 participants


I've been running into problems where an optionalDependencies entry is specified but npm treats it exactly like a regular dependency, which causes the whole install to fail instead of ignoring the optional package. This feature seems really weird. npm should just ignore optionalDependencies outright and if people want extra magic they can fiddle with the packages themselves.

npm member
isaacs commented Aug 21, 2012

The "try-and-continue-on-failure" behavior seems to be not surprising to most people. I think you had an old version that only continued on certain types of failures, but not others, which was the problem you ran into.

An opt-out would be nice.

@isaacs isaacs added a commit that closed this issue Aug 21, 2012
@isaacs isaacs Fix #2737 Add --no-optional to opt out of optionalDependencies
Or 'npm config set optional false' to make them never be used ever.
@isaacs isaacs closed this in 3bf7d2f Aug 21, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.