atom-haskell-archive / haskell-ghc-mod

haskell-ghc-mod atom package
https://atom.io/packages/haskell-ghc-mod
MIT License
69 stars 20 forks source link

Haskell-ghc-mod: ghc-mod failed to launch. It is probably missing or misconfigured. ENOENT #135

Closed benjamin-rood closed 8 years ago

benjamin-rood commented 8 years ago

Atom Version: 1.7.2 System: Mac OS X 10.11.4 Thrown From: haskell-ghc-mod package, v1.12.0

Stack Trace

Haskell-ghc-mod: ghc-mod failed to launch. It is probably missing or misconfigured. ENOENT

At Error: spawn ghc-mod ENOENT
PATH: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Library/TeX/texbin:/Users/br/gopath/bin:/usr/local/bin:/Users/br/scripts
path: undefined
Path: undefined

Error
    at /Users/br/.atom/packages/haskell-ghc-mod/lib/ghc-mod/ghc-modi-process.coffee:60:28
    at exithandler (child_process.js:232:5)
    at ChildProcess.errorhandler (child_process.js:244:5)
    at emitOne (events.js:77:13)
    at ChildProcess.emit (events.js:169:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
    at onErrorNT (internal/child_process.js:344:16)
    at doNTCallback2 (node.js:465:9)
    at process._tickCallback (node.js:379:17)

Commands

Config

{
  "core": {
    "disabledPackages": [
      "linter-hlint"
    ],
    "themes": [
      "atom-material-ui",
      "gruvbox"
    ]
  }
}

Installed Packages

# User
atom-material-ui, v1.2.10
autocomplete-go, v1.0.6
autocomplete-haskell, v0.6.5
builder-go, v1.0.0
go-config, v1.1.4
go-get, v1.0.3
go-plus, v4.1.0
gofmt, v1.1.6
gometalinter-linter, v1.1.0
gorename, v1.0.2
gruvbox, v1.0.5
haskell-ghc-mod, v1.12.0
haskell-grammar, v0.4.0
ide-haskell, v1.6.0
language-elmx, v1.2.1
language-haskell, v1.7.10
linter, v1.11.4
navigator-godef, v1.0.3
tester-go, v1.0.4

# Dev
No dev packages
lierdakil commented 8 years ago

Please see https://github.com/atom-haskell/ide-haskell#requirements and also maybe https://github.com/atom-haskell/haskell-ghc-mod#configuration, which expands on some options a bit.

stremlenye commented 8 years ago

Hi @lierdakil, I've checked your links, but the didn't help me to solve the problem. Could I provide any extra information to help resolve the issue?

lierdakil commented 8 years ago

Atom couldn't find ghc-mod executable. Is it installed? Where? Is that directory in PATH? Does Atom get correct PATH from environment? Do you need to specify full path to ghc-mod executable in package settings? Find answers to these questions and you'll probably solve ENOENT error. Now that doesn't mean there are no other problems, but I can't help with those if I don't know about them.

stremlenye commented 8 years ago

Is it installed? Yes Where? ~/.cabal/bin Is that directory in PATH? Yes Does Atom get correct PATH from environment? Yes Do you need to specify full path to ghc-mod executable in package settings? I don't know, but I've tried and that hasn't fixed the problem

lierdakil commented 8 years ago

I don't see /Users/br/.cabal/bin in PATH that Atom reports (from initial bug report): PATH: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Library/TeX/texbin:/Users/br/gopath/bin:/usr/local/bin:/Users/br/scripts

So your answer to either third or fourth question is incorrect.

Try putting /Users/br/.cabal/bin/ghc-mod into 'Ghc Mod Path` setting.

stremlenye commented 8 years ago

I've tried even that, but still no effect.

lierdakil commented 8 years ago

@stremlenye, I just noticed you're not OP. Atom should create an error report. You can copy it to clipboard: atom-report Please paste it here.

MaxDaten commented 8 years ago

I updated the plugin to the new version yesterday and bumped into this problem now. I'm using stack. Because of issue #136 I have to work with ghc-mod-5.4.0.0. I did not changed anything I my previously working configuration.

Example:

> stack new simple
> atom simple

Trace:

haskell-ghc-mod warning: Reading cabal sandbox config failed with  Error: ENOENT: no such file or directory, open '/Users/jloos/Workspace/hs/simple/cabal.sandbox.config'(…)
/Users/jloos/.atom/packages/haskell-ghc-mod/lib/util.coffee:63 haskell-ghc-mod warning: No cabal sandbox found
/Users/jloos/.atom/packages/haskell-ghc-mod/lib/ghc-mod/ghc-modi-process.coffee:133 Uncaught Error: spawn ghc ENOENT
2util.coffee:36 haskell-ghc-mod warning: ghc-mod said: simple-0.1.0.0: configure
util.coffee:36 haskell-ghc-mod warning: ghc-modi said: simple-0.1.0.0: configure
util.coffee:36 haskell-ghc-mod warning: ghc-mod said: Configuring simple-0.1.0.0...
util.coffee:36 haskell-ghc-mod warning: ghc-modi said: Configuring simple-0.1.0.0...
util.coffee:36 haskell-ghc-mod warning: ghc-mod said: Configuring simple-0.1.0.0...
lierdakil commented 8 years ago

@MaxDaten, try updating Atom packages. Hopefully it's fixed. If not, let me know.

MaxDaten commented 8 years ago

@lierdakil thanks alot, the new version fixed it for me.

Szuuuken commented 8 years ago

I solved the problem by adding the cabal bin path to my PATH env variable.

You could do this for example by executing: export PATH=$PATH:/home/myUser/.cabal/bin (but be aware, this isn't permanent)

lierdakil commented 8 years ago

@Szuuuken, that's exactly what 'Additional Path Directories' setting is for. If you add /home/myUser/.cabal/bin there, Atom will prepend that to PATH before running ghc-mod (effectively the same as PATH=/home/myUser/.cabal/bin:$PATH).

Vishtar commented 8 years ago

Today i'm install this program, but:

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.7.3 System: Unknown Windows Version Thrown From: haskell-ghc-mod package, v1.14.2

Stack Trace

Haskell-ghc-mod: ghc-mod failed to launch. It is probably missing or misconfigured. ENOENT

At Error: spawn ghc-mod ENOENT
PATH: undefined
path: undefined
Path: C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Haskell\bin;C:\Program Files\Haskell Platform\7.10.3\lib\extralibs\bin;C:\Program Files\Haskell Platform\7.10.3\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Haskell Platform\7.10.3\mingw\bin;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Users\Viktor\AppData\Roaming\cabal\bin

Error
    at file:///C:/Users/Viktor/.atom/packages/haskell-ghc-mod/lib/ghc-mod/ghc-modi-process.coffee:83:30
    at exithandler (child_process.js:232:5)
    at ChildProcess.errorhandler (child_process.js:244:5)
    at emitOne (events.js:77:13)
    at ChildProcess.emit (events.js:169:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
    at onErrorNT (internal/child_process.js:344:16)
    at doNTCallback2 (node.js:465:9)
    at process._tickCallback (node.js:379:17)

Commands

     -0:39.4.0 tree-view:toggle (atom-text-editor.editor.is-focused)
undefined -0:38.1.0 core:move-down (atom-text-editor.editor.is-focused)
 11x -0:28.9.0 core:page-down (atom-text-editor.editor.is-focused)
     -0:25.9.0 core:page-up (atom-text-editor.editor.is-focused)
  6x -0:21.4.0 core:page-down (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "one-dark-syntax"
    ]
  }
}

Installed Packages

# User
auto-encoding, v0.5.3
autocomplete-haskell, v0.6.5
file-icons, v1.7.12
haskell-ghc-mod, v1.14.2
highlight-selected, v0.11.2
ide-haskell, v1.6.5
ide-haskell-cabal, v1.4.0
language-haskell, v1.7.15
linter, v1.11.4
linter-csslint, v1.3.2
linter-gcc, v0.6.14

# Dev
No dev packages
lierdakil commented 8 years ago

@Vishtar, did you install ghc-mod? cabal install ghc-mod

lierdakil commented 8 years ago

Closing due to inactivity

Fabs commented 7 years ago

Had the same issue, with updated version of the packages. I ran stack install ghc-mod. Worked fine after that.