6

スタックを介してGHCをインストールしました(stack ghc -- --versionGHC-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て変更できるかもしれないと思いました。

stack >= 0.1.8 で GHCJS を使用するには、stack.yaml の compiler フィールドに GHCJS バージョンを配置します。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スタックでインストールしたいだけです。

4

1 に答える 1

10

このページを見てください: 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 には時間がかかります。

于 2016-05-16T13:27:37.470 に答える