Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Give better error message than "failed to run undefined undefined" if node unavailable #30

Open
flungo opened this issue Apr 23, 2017 · 6 comments

Comments

@flungo
Copy link

flungo commented Apr 23, 2017

When node is unavailable, the error that is presented is really unclear:

failed to run undefined undefined
spawn /usr/lib/node_modules/atom-package-manager/bin/node ENOENT

It isn't even obvious that the error is caused by the linter-write-good plugin - I only knew because I had just installed it when getting this message. Can you implement this failure in a more graceful way with a useful error message suggesting that the user alters their configuration?

For reference, node is not available at /usr/lib/node_modules/atom-package-manager/bin/node when atom is installed using the atom package for Arch Linux.

@gepoch
Copy link
Contributor

gepoch commented Apr 25, 2017

Hey thanks for the info. This is a good call. There are probably better search strategies for finding a valid node binary as well, before we fall back to raising an error message. I'll look into this when I can, otherwise PRs are accepted :)

@es02
Copy link

es02 commented May 30, 2017

I am having the same issue.

Workaround:

wget https://nodejs.org/dist/v6.10.3/node-v6.10.3-linux-x64.tar.xz
tar -xvftz node-v6.10.3-linux-x64.tar.xz
cd node-v6.10.3-linux-x64/bin
chmod +x node
sudo ln -s ./node /usr/lib/node_modules/atom-package-manager/bin/node 

@flungo
Copy link
Author

flungo commented May 30, 2017

I just set Path to the node interpreter to use. Defaults to Atom's to /usr/bin/node (node installed on the system identifiable with which node).

If I get some time I might look into this, but if anyone else wants to pick this up and resolve. I wonder if there is a way of actually detecting which node binary Atom is using rather than just defaulting to the one that is expected to exist as /usr/lib/node_modules/atom-package-manager/bin/node. The minimum requirement is that a reasonable error message is shown.

@ChasNelson1990
Copy link

Just to say - I've just spent twenty minutes with this same issue (also installed on Arch Linux). For some reason this issue doesn't come up when searching (via Duck Duck Go). I wonder if it might be worth including failed to run undefined undefined to the issue title to make it easier to find until a solution is proposed.

@gepoch gepoch changed the title Give better error message if node unavailable Give better error message than "failed to run undefined undefined" if node unavailable Apr 10, 2018
@gepoch
Copy link
Contributor

gepoch commented Apr 10, 2018

Updated.

Sorry guys, I've actually switched back to vim since writing this plugin, but if someone had a PR, I'm happy to release it!

@groodle
Copy link

groodle commented Jun 1, 2018

Creating symlink back to the system node binary worked for me. On Arch:

sudo ln -s /usr/bin/node /usr/lib/node_modules/atom-package-manager/bin/node

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

No branches or pull requests

5 participants