jagregory / atom-pandoc-preview

Pandoc-powered Previewer for Atom
MIT License
14 stars 7 forks source link

Error 'Uncaught Error: spawn pandoc ENOENT' #14

Closed twsh closed 9 years ago

twsh commented 9 years ago

Whenever I try to preview I get the error 'Uncaught Error: spawn pandoc ENOENT'. I'm using version 0.1.2, Atom version 0.165.0 on OS X.

Here is the stack trace:

Error: spawn pandoc ENOENT
  at exports._errnoException (util.js:742:11)
  at Process.ChildProcess._handle.onexit (child_process.js:1051:32)
  at child_process.js:1142:20
  at process._tickCallback (node.js:378:11)
jagregory commented 9 years ago

Have you got your PATH set up correctly? See: Problems with PATH

twsh commented 9 years ago

I made the change you described; it didn't avoid the problem. (Pandoc is properly installed and in my path.)

One thing that does suggest that it might be a path issue of some sort: if I do $ atom foo.md it works fine.

twsh commented 9 years ago

I don't know if this is relevant: I have the same problem on Ubuntu 14.04. So it's not just an OS X quirk.

Skyfold commented 9 years ago

I had the same problem, with the same error message as above. To fix it you have to:

 vi `which atom`

Add "env" before this line:

open -a "$ATOM_PATH/$ATOM_APP_NAME" -n --args --executed-from="$(pwd)" --pid=$$ --path-environment="$PATH" "$@"

Like so:

env open -a "$ATOM_PATH/$ATOM_APP_NAME" -n --args --executed-from="$(pwd)" --pid=$$ --path-environment="$PATH" "$@"

Then call atom from the command line. I have yet to make it work by calling atom from spotlight

I also tried editing /etc/launchd.conf, adding in setenv PATH /Applications/Atom.app to the file and reloading everything with grep -E "^setenv" /etc/launchd.conf | xargs -t -L 1 launchctl, but that only gave me this error instead:

'pandoc' could not be spawned. Is it installed and on your path? If so please open an issue on the package spawning the process.

jeffmcneill commented 9 years ago

I've got the same issue. Will work when I run atom from command line, but not launch as an icon/explorer. I've added "env" and that didn't fix it. Any updates of things to try out?

jagregory commented 9 years ago

I'm afraid not. This is a more general issue with Atom (and Sublime) and Macs, unfortunately.

maxheld83 commented 9 years ago

I have the same problem, on OS X – even though PATH is set up as indicated:

open -a "$ATOM_PATH/$ATOM_APP_NAME" -n --args --executed-from="$(pwd)" --pid=$$ --path-environment="$PATH" "$@"

Starting Atom from CLI works just fine, oddly.