2016-05-16 14 views
4

Ich habe GHC Stack installiert durch (so dass stack ghc -- --version zeigt GHC-7.10.3)installieren ghcjs von Stapel

$ stack install ghcjs 

Run from outside a project, using implicit global project config 
Using resolver: lts-5.2 from implicit global project's config file: /home/john/.stack/global-project/stack.yaml 
The following target packages were not found: ghcjs 

Einige Ressourcen vorschlagen ghcjs etwas experimentell ist (wenn auch in den weiteren Stufen).


bei http://docs.haskellstack.org/en/stable/ghcjs/ Blick dachte ich, vielleicht ich stack.yaml und ändern finden konnten.

verwenden GHCJS mit Stack> = 0.1.8, in dem Compiler Feld stack.yaml eine GHCJS Version setzen ... dann stack setup

$ cat ~/.stack/global-project/stack.yaml 
# This is the implicit global project's config file, which is only used when 
# 'stack' is run outside of a real project. Settings here do _not_ act as 
# defaults for all projects. To change stack's default settings, edit 
# '/home/john/.stack/config.yaml' instead. 
# 
# For more information about stack's configuration, see 
# http://docs.haskellstack.org/en/stable/yaml_configuration.html 
# 
flags: {} 
extra-package-dbs: [] 
packages: [] 
extra-deps: [] 
resolver: lts-5.2 

Wir bei config.yaml aussehen gesagt zu Das sieht genauso leer aus. Ist das überhaupt richtig, gehe ich in eine Sackgasse?

$ cat ~/.stack/config.yaml 
# This file contains default non-project-specific settings for 'stack', used 
# in all projects. For more information about stack's configuration, see 
# http://docs.haskellstack.org/en/stable/yaml_configuration.html 
# 
{} 

Ich will nur ghcjs mit Stack installieren.

Antwort

9

Werfen Sie einen Blick auf diese Seite: http://docs.haskellstack.org/en/stable/ghcjs/

ich versuchen würde,:

  1. Starten Sie ein neues Stapel-Projekt, z.B. stack new js-test

  2. die stack.yaml Datei ändern diese Stanze durch Zugabe (aus dem oben genannten Link genommen):

    compiler: ghcjs-0.2.0.20160414_ghc-7.10.3 
    compiler-check: match-exact 
    setup-info: 
        ghcjs: 
        source: 
         ghcjs-0.2.0.20160414_ghc-7.10.3: 
         url: https://s3.amazonaws.com/ghcjs/ghcjs-0.2.0.20160414_ghc-7.10.3.tar.gz 
         sha1: 6d6f307503be9e94e0c96ef1308c7cf224d06be3 
    
  3. Ändern Sie den resolver: auf LTS-5.12 - dies die oben Strophe übereinstimmt.

  4. Führen Sie stack setup aus, um den Compiler zu installieren.

Schritt 4 dauert eine Weile.

+1

Ich kann kein Häkchen setzen, weil es immer noch installiert :-) –

+0

Meine 'Stack-Setup' gerade fertig, also hängen Sie dort! – ErikR