我在Windows 7上使用原子编辑器一直在学习haskell。在我创建.cabal文件之前,这一直很好。现在我不断收到红色错误消息。实际上,由于错误消息的弹出速度比删除它们的速度快,因此无法使用。 haskell计划是一个微不足道的hello世界。
module Main where
main :: IO ()
main = putStrLn "Hello from Haskell!"
.cabal文件如下:
-- Initial hello-haskell.cabal generated by cabal init. For further
-- documentation, see http://haskell.org/cabal/users-guide/
name: hello-haskell
version: 0.1.0.0
synopsis: Hello Haskell
description: Hello Haskell
license: BSD3
license-file: LICENSE
author: Tyrone Faulkner
maintainer: p75213@gmail.com
-- copyright:
category: None
build-type: Simple
extra-source-files: ChangeLog.md
cabal-version: >=1.10
executable hello-haskell
main-is: Main.hs
ghc-options: -Wall -fwarn-tabs
-- other-modules:
-- other-extensions:
build-depends: base >=4.8 && <4.9
hs-source-dirs: src
default-language: Haskell2010
错误消息如下:
* [输入以下步骤重现:] 1. ... 2. ... Atom版本:1.8.0 系统:Microsoft Windows 7 Professional 引发:haskell-ghc-mod包,v1.17.2
Haskell-ghc-mod:ghc-mod交互式命令类型失败,错误ghc-modi崩溃
At caps: {"version":[5,5,0,0],"fileMap":true,"quoteArgs":true,"optparse":true,"typeConstraints":false,"browseParents":false,"interactiveCaseSplit":false} URI: C:\Users\Tyrone\MyProjects\hello-haskell\src\Main.hs Args: --,1,1 message: log:
-2.884s: {}
-2.884s: "Trying to run ghc-modi in C:\\Users\\Tyrone\\MyProjects\\hello-haskell"
-2.884s: "Checking for ghc-modi in C:\\Users\\Tyrone\\MyProjects\\hello-haskell"
-2.884s: "Spawning new ghc-modi instance for C:\\Users\\Tyrone\\MyProjects\\hello-haskell with",{"cwd":"C:\\Users\\Tyrone\\MyProjects\\hello-haskell","env":{"ALLUSERSPROFILE":"C:\\ProgramData","APPDATA":"C:\\Users\\Tyrone\\AppData\\Roaming","ATOM_HOME":"C:\\Users\\Tyrone\\.atom","CommonProgramFiles":"C:\\Program Files\\Common Files","COMPUTERNAME":"TYRONE-PC","ComSpec":"C:\\Windows\\system32\\cmd.exe","FP_NO_HOST_CHECK":"NO","GHC":"c:\\users\\tyrone\\appdata\\local\\programs\\stack\\i386-windows\\ghc-7.10.3\\bin","GOOGLE_API_KEY":"AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q","HOMEDRIVE":"C:","HOMEPATH":"\\Users\\Tyrone","LOCALAPPDATA":"C:\\Users\\Tyrone\\AppData\\Local","LOGONSERVER":"\\\\TYRONE-PC","NUMBER_OF_PROCESSORS":"2","OS":"Windows_NT","Path":"C:\\ProgramData\\Oracle\\Java\\javapath;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Skype\\Phone\\;C:\\Program Files\\Support Tools\\;C:\\Program Files\\Git\\cmd;C:\\Users\\Tyrone\\AppData\\Roaming\\local\\bin;c:\\users\\tyrone\\appdata\\local\\atom\\bin;c:\\stack_root;c:\\users\\tyrone\\appdata\\local\\programs\\stack\\i386-windows\\ghc-7.10.3\\bin","PATHEXT":".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC","PROCESSOR_ARCHITECTURE":"x86","PROCESSOR_IDENTIFIER":"x86 Family 6 Model 15 Stepping 6, GenuineIntel","PROCESSOR_LEVEL":"6","PROCESSOR_REVISION":"0f06","ProgramData":"C:\\ProgramData","ProgramFiles":"C:\\Program Files","PSModulePath":"C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\","PUBLIC":"C:\\Users\\Public","ROOT_ATOM_DIRECTORY":"c:\\users\\tyrone\\appdata\\local\\atom\\bin","SESSIONNAME":"Console","skype":"C:\\Program Files\\Skype\\Phone\\","STACK_ROOT":"c:\\stack_root","SystemDrive":"C:","SystemRoot":"C:\\Windows","TEMP":"C:\\Users\\Tyrone\\AppData\\Local\\Temp","TMP":"C:\\Users\\Tyrone\\AppData\\Local\\Temp","USERDOMAIN":"Tyrone-PC","USERNAME":"Tyrone","USERPROFILE":"C:\\Users\\Tyrone","windir":"C:\\Windows","windows_tracing_flags":"3","windows_tracing_logfile":"C:\\BVTBin\\Tests\\installpackage\\csilogfile.log","NODE_PATH":"C:\\Users\\Tyrone\\AppData\\Local\\atom\\app-1.8.0\\resources\\app.asar\\exports","NODE_ENV":"production","PATH":"C:\\stack_root\\global-project\\.stack-work\\install\\6840de01\\bin;C:\\stack_root\\snapshots\\48375d44\\bin;C:\\ProgramData\\Oracle\\Java\\javapath;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Skype\\Phone\\;C:\\Program Files\\Support Tools\\;C:\\Program Files\\Git\\cmd;C:\\Users\\Tyrone\\AppData\\Roaming\\local\\bin;c:\\users\\tyrone\\appdata\\local\\atom\\bin;c:\\stack_root;c:\\users\\tyrone\\appdata\\local\\programs\\stack\\i386-windows\\ghc-7.10.3\\bin"},"encoding":"utf-8","maxBuffer":null}
-2.884s: "Spawning new ghc-modi instance for C:\\Users\\Tyrone\\MyProjects\\hello-haskell with options = ",{"cwd":"C:\\Users\\Tyrone\\MyProjects\\hello-haskell","env":{"ALLUSERSPROFILE":"C:\\ProgramData","APPDATA":"C:\\Users\\Tyrone\\AppData\\Roaming","ATOM_HOME":"C:\\Users\\Tyrone\\.atom","CommonProgramFiles":"C:\\Program Files\\Common Files","COMPUTERNAME":"TYRONE-PC","ComSpec":"C:\\Windows\\system32\\cmd.exe","FP_NO_HOST_CHECK":"NO","GHC":"c:\\users\\tyrone\\appdata\\local\\programs\\stack\\i386-windows\\ghc-7.10.3\\bin","GOOGLE_API_KEY":"AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q","HOMEDRIVE":"C:","HOMEPATH":"\\Users\\Tyrone","LOCALAPPDATA":"C:\\Users\\Tyrone\\AppData\\Local","LOGONSERVER":"\\\\TYRONE-PC","NUMBER_OF_PROCESSORS":"2","OS":"Windows_NT","Path":"C:\\ProgramData\\Oracle\\Java\\javapath;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Skype\\Phone\\;C:\\Program Files\\Support Tools\\;C:\\Program Files\\Git\\cmd;C:\\Users\\Tyrone\\AppData\\Roaming\\local\\bin;c:\\users\\tyrone\\appdata\\local\\atom\\bin;c:\\stack_root;c:\\users\\tyrone\\appdata\\local\\programs\\stack\\i386-windows\\ghc-7.10.3\\bin","PATHEXT":".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC","PROCESSOR_ARCHITECTURE":"x86","PROCESSOR_IDENTIFIER":"x86 Family 6 Model 15 Stepping 6, GenuineIntel","PROCESSOR_LEVEL":"6","PROCESSOR_REVISION":"0f06","ProgramData":"C:\\ProgramData","ProgramFiles":"C:\\Program Files","PSModulePath":"C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\","PUBLIC":"C:\\Users\\Public","ROOT_ATOM_DIRECTORY":"c:\\users\\tyrone\\appdata\\local\\atom\\bin","SESSIONNAME":"Console","skype":"C:\\Program Files\\Skype\\Phone\\","STACK_ROOT":"c:\\stack_root","SystemDrive":"C:","SystemRoot":"C:\\Windows","TEMP":"C:\\Users\\Tyrone\\AppData\\Local\\Temp","TMP":"C:\\Users\\Tyrone\\AppData\\Local\\Temp","USERDOMAIN":"Tyrone-PC","USERNAME":"Tyrone","USERPROFILE":"C:\\Users\\Tyrone","windir":"C:\\Windows","windows_tracing_flags":"3","windows_tracing_logfile":"C:\\BVTBin\\Tests\\installpackage\\csilogfile.log","NODE_PATH":"C:\\Users\\Tyrone\\AppData\\Local\\atom\\app-1.8.0\\resources\\app.asar\\exports","NODE_ENV":"production","PATH":"C:\\stack_root\\global-project\\.stack-work\\install\\6840de01\\bin;C:\\stack_root\\snapshots\\48375d44\\bin;C:\\ProgramData\\Oracle\\Java\\javapath;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Skype\\Phone\\;C:\\Program Files\\Support Tools\\;C:\\Program Files\\Git\\cmd;C:\\Users\\Tyrone\\AppData\\Roaming\\local\\bin;c:\\users\\tyrone\\appdata\\local\\atom\\bin;c:\\stack_root;c:\\users\\tyrone\\appdata\\local\\programs\\stack\\i386-windows\\ghc-7.10.3\\bin"},"encoding":"utf-8","maxBuffer":null}
-2.884s: "Started interactive action block in C:\\Users\\Tyrone\\MyProjects\\hello-haskell"
-2.884s: "Running ghc-modi command type","C:\\Users\\Tyrone\\MyProjects\\hello-haskell\\src\\Main.hs","--",1,1
-2.419s: "ghc-modi said: "
-2.419s: "ghc-modi said: on the commandline: Warning:"
-2.419s: "ghc-modi said: -package-conf=C:\\Users\\Tyrone\\AppData\\Roaming\\ghc-mod\\cabal-helper\\Cabal-1.24.0.0-db-7.10.3 is deprecated: Use -package-db instead"
-1.936s: "ghc-modi said: [1 of 5] Compiling CabalHelper.Types ( CabalHelper\\Types.hs, C:\\Users\\Tyrone\\AppData\\Roaming\\ghc-mod\\cabal-helper\\CabalHelper\\Types.o )"
-0.807s: "ghc-modi said: [2 of 5] Compiling CabalHelper.Common ( CabalHelper\\Common.hs, C:\\Users\\Tyrone\\AppData\\Roaming\\ghc-mod\\cabal-helper\\CabalHelper\\Common.o )"
-0.445s: "ghc-modi said: [3 of 5] Compiling CabalHelper.Sandbox ( CabalHelper\\Sandbox.hs, C:\\Users\\Tyrone\\AppData\\Roaming\\ghc-mod\\cabal-helper\\CabalHelper\\Sandbox.o )"
-0.228s: "ghc-modi said: [4 of 5] Compiling CabalHelper.Licenses ( CabalHelper\\Licenses.hs, C:\\Users\\Tyrone\\AppData\\Roaming\\ghc-mod\\cabal-helper\\CabalHelper\\Licenses.o )"
-0.071s: "ghc-modi said: "
-0.071s: "ghc-modi said: CabalHelper\\Licenses.hs:38:28:"
-0.071s: "ghc-modi said: Not in scope: `lookupComponentId'"
-0.07s: "ghc-modi said: Perhaps you meant one of these:"
-0.07s: "ghc-modi said: `lookupComponent' (imported from Distribution.Simple.LocalBuildInfo),"
-0.07s: "ghc-modi said: `localComponentId' (imported from Distribution.Simple.LocalBuildInfo)"
-0.07s: "ghc-modi said: "
-0.07s: "ghc-modi said: CabalHelper\\Licenses.hs:53:18:"
-0.07s: "ghc-modi said: Ambiguous occurrence `lookupInstalledPackageId'"
-0.07s: "ghc-modi said: It could refer to either `CabalHelper.Licenses.lookupInstalledPackageId',"
-0.07s: "ghc-modi said: defined at CabalHelper\\Licenses.hs:38:1"
-0.07s: "ghc-modi said: or `Distribution.Simple.PackageIndex.lookupInstalledPackageId',"
-0.07s: "ghc-modi said: imported from `Distribution.Simple.PackageIndex' at CabalHelper\\Licenses.hs:24:1-39"
-0.07s: "ghc-modi said: "
-0.07s: "ghc-modi said: CabalHelper\\Licenses.hs:74:10:"
-0.07s: "ghc-modi said: Ambiguous occurrence `lookupInstalledPackageId'"
-0.07s: "ghc-modi said: It could refer to either `CabalHelper.Licenses.lookupInstalledPackageId',"
-0.07s: "ghc-modi said: defined at CabalHelper\\Licenses.hs:38:1"
-0.07s: "ghc-modi said: or `Distribution.Simple.PackageIndex.lookupInstalledPackageId',"
-0.07s: "ghc-modi said: imported from `Distribution.Simple.PackageIndex' at CabalHelper\\Licenses.hs:24:1-39"
-0.012s: "ghc-modi said: ghc-mod: readCreateProcess: C:\\stack_root\\snapshots\\48375d44\\libexec\\cabal-helper-wrapper.exe \"--with-ghc=ghc\" \"--with-ghc-pkg=ghc-pkg\" \"--with-cabal=cabal\" \"C:\\\\Users\\\\Tyrone\\\\MyProjects\\\\hello-haskell\" \"C:\\\\Users\\\\Tyrone\\\\MyProjects\\\\hello-haskell\\\\dist\" \"package-db-stack\" \"entrypoints\" \"source-dirs\" \"ghc-options\" \"ghc-src-options\" \"ghc-pkg-options\" \"ghc-merged-pkg-options\" \"ghc-lang-options\" \"licenses\" \"flags\" \"config-flags\" \"non-default-config-flags\" \"compiler-version\" (exit 1): failed"
-0.001s: "ghc-modi for C:\\Users\\Tyrone\\MyProjects\\hello-haskell ended with 1"
-0.001s: "ghc-modi for C:\\Users\\Tyrone\\MyProjects\\hello-haskell ended with 1"
-0.001s: "Running ghc-modi command unmap-file","C:\\Users\\Tyrone\\MyProjects\\hello-haskell\\src\\Main.hs" 0s: {"name":"ghc-modi crashed"}
ghc-modi crashed
at module.exports.Util.mkError (file:///C:/Users/Tyrone/.atom/packages/haskell-ghc-mod/lib/util.coffee:225:15)
at ChildProcess.exitCallback (file:///C:/Users/Tyrone/.atom/packages/haskell-ghc-mod/lib/ghc-mod/interactive-process.coffee:77:20)
at emitTwo (events.js:92:20)
at ChildProcess.emit (events.js:172:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
-2:22.4.0 core:copy (atom-text-editor.editor.is-focused)
json { "core": {
"automaticallyUpdate": false,
"themes": [
"atom-light-ui",
"atom-light-syntax"
] } }
```咖啡
答案 0 :(得分:0)
答案 1 :(得分:0)
我升级到ghc-mod-5.6.0.0。我也在3个地方安装了ghc-mod。由于我的PATH指向所有3个,我暂时重命名了那些旧的exe文件,并且只使用了最新的5.6.0.0。