linter-write-good
linter-write-good copied to clipboard
Give better error message than "failed to run undefined undefined" if node unavailable
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.
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 :)
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
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.
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.
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!
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