$ xo --init
Error: spawn yarn ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:227:19)
at onErrorNT (internal/child_process.js:404:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:721:11)
at startup (internal/bootstrap/node.js:228:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:576:3)
It took me a while to realise that xo had detected the use of yarn (probably due to yarn.lock), but the yarn command (or module) wasn't currently available. This situation should at least result in a human-readable error if there isn't a better way to handle it.
Yes, we should show a user-friendly error, like:
This project uses Yarn but you don't seem to have Yarn installed.
Run `npm install --global yarn` to install it.
@sindresorhus I just send a PR to the xo-init repo for send this message.
https://github.com/xojs/xo-init/pull/17