Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xo --init crashes out if yarn.lock is present but yarn isn't available #325

Closed
yozlet opened this issue May 17, 2018 · 2 comments · Fixed by xojs/create-xo#17
Closed

xo --init crashes out if yarn.lock is present but yarn isn't available #325

yozlet opened this issue May 17, 2018 · 2 comments · Fixed by xojs/create-xo#17

Comments

@yozlet
Copy link

yozlet commented May 17, 2018

$ 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.

@sindresorhus
Copy link
Member

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.

@07Gond
Copy link

07Gond commented Oct 6, 2018

@sindresorhus I just send a PR to the xo-init repo for send this message.
xojs/create-xo#17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants