Describe the bug
Wasn't sure if this is considered a bug or a missing feature, when adding optional dependencies in the package.json file yarn will fail installation if the dependency is not found while with npm it skips the optional dependency when not found.
To Reproduce
Add a non existing optional dependency to package,json:
"optionalDependencies": {
"thispackagedoesntexist": "^1.0.0"
}
Screenshots
With optional dependencies:

Without:

Environment if relevant (please complete the following information):
- OS: Linux
- Node version v14.14.0
- Yarn version 2.4.0