question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 7 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
develarcommented, Jan 3, 2017

Please set env DEBUG=electron-builder and attach log of the terminal output.

0reactions
develarcommented, Jan 9, 2017

First of all thanks for this great tool!

Thank you for warm words 😃 Fix landed in the 11.2.1.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found