Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


optionalDependencies is really wonky #2737

substack opened this Issue · 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.


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 closed this issue from a commit
@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
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.