| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| if (yarnExists) { | ||
| callback(code, 'yarn', yarnArgs); | ||
| return; | ||
| } |
There was a problem hiding this comment.
You need to call fallbackToNpm() here, so that we'll fall back to npm if the yarn process emitted the ENOENT error, which is asynchronous (handled above).
Sorry, something went wrong.
There was a problem hiding this comment.
Addressed
Sorry, something went wrong.
| var yarnProc; | ||
| var yarnExists = true; | ||
| try { | ||
| yarnProc = spawn('yarn', yarnArgs, {stdio: 'inherit'}); |
There was a problem hiding this comment.
I'd only wrap this single line with try-catch, because that's the thing we need to catch the errors from. I don't want us to get stuck in an infinite loop if something else fails in the fallback npm command for example.
Sorry, something went wrong.
There was a problem hiding this comment.
Addressed
Sorry, something went wrong.
|
Looks good to me 👍 |
Sorry, something went wrong.
* Catch synchronous errors from spawning yarn * Fix issues
* Catch synchronous errors from spawning yarn * Fix issues
| Back | FazBrowse Home | New Git URL |
Maybe fixes #1200.
Apparently spawn sometimes fails synchronously and sometimes fails in an event emitter.
I restructured the code a tiny bit.