2016-05-16 80 views
4

安裝ghcjs我通過安裝GHC棧(這樣stack ghc -- --version顯示GHC-7.10.3)從堆棧

$ 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 

一些資源建議ghcjs有些實驗(儘管在進一步的階段)。


看着http://docs.haskellstack.org/en/stable/ghcjs/我想,也許我能找到stack.yaml和改變它。

要使用棧> = 0.1.8使用GHCJS,放置一個GHCJS版本stack.yaml的編譯器領域...然後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 

我們被告知要看看config.yaml看起來同樣空白。這是對的嗎,我會走上死路?

$ 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 
# 
{} 

我只是想安裝ghcjs與堆棧。

回答

9

看一看這個頁面:http://docs.haskellstack.org/en/stable/ghcjs/

我會嘗試:

  1. 開始一個新的堆棧的項目,例如stack new js-test

  2. 通過添加該節(由上述鏈接截取)修改stack.yaml文件:

    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. 更改resolver:到LTS-5.12 - 這上面節匹配。

  4. 運行stack setup來安裝編譯器。

第4步需要一段時間。

+1

我不能把一個複選標記因爲它仍然安裝:-) –

+0

我的'堆疊安裝程序'剛剛完成,所以掛在那裏! – ErikR