Yarn doesn't correctly handle optional dependencies
See original GitHub issue- Version: 10.16
- Target: all
First of all thanks for this great tool! 🥇
I experience one problem only present when using electron-builder
together with yarn
:
electron-builder
will fail if a optional dependency errors during install. npm
handles this correctly and doesn’t throw a error.
yarn
itself also handles optional dependencies correctly if electron-builder
’s postinstall/rebuild script isn’t used.
Here is a concrete example:
We are using electron-builder
inside nteract but one of our dependencies requires canvas
as a optional dependency (which we don’t need inside Electron). Installing canvas
will likely fail on some systems and will make our whole build fail if we use yarn
for installing.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Types of dependencies | Yarn
Some dependencies are needed to build your project, others are needed when you're running your program. ... Optional dependencies are just that: optional....
Read more >NPM vs. Yarn: Which Package Manager Should You Choose?
We'll be comparing NPM vs. Yarn side by side so that you can make the right decision on the one to go for...
Read more >How do I override nested dependencies with `yarn`?
A bit of searching found the yarn --flat option, which will force yarn to choose no more than one of each package in...
Read more >package.json - npm Docs
Running npm install --no-optional will prevent these dependencies from being installed. It is still your program's responsibility to handle the lack of the ......
Read more >Understanding Peer Dependencies in JavaScript
Although useful for all developers alike, peer dependencies is a ... a package that your code requires, but doesn't directly require it.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Please set env DEBUG=electron-builder and attach log of the terminal output.
Thank you for warm words 😃 Fix landed in the 11.2.1.