Purescript 0.12入门

时间:2018-05-30 08:23:04

标签: purescript

我试图运行非常基本的流程:

1)安装工具:

  

npm install -g pulp bower

纸浆版本12.2.0 使用C:\ Users \ panda.psvm \ current \ bin \ purs.EXE追求版本0.12.0 C:\ Users \ panda> bower --version 1.8.4

2)从这个答案开始,我安装了https://stackoverflow.com/a/50554135/1358421

C:\ Users \ panda> purs --version 0.12.0

好的,让我们创建一个项目。

  

c:\ home \ projects \ sandbox \ purr> mkdir hello-purr

     

c:\ home \ projects \ sandbox \ purr> cd hello-purr

     

C:\家\项目\沙箱\呼噜声\你好-呼噜声>   初始纸浆

SET DEFAULT NULL

项目的骨架成功生成。

尝试运行它:

  纸浆运行

c:\home\projects\sandbox\purr\hello-purr>pulp init
* Generating project skeleton in c:\home\projects\sandbox\purr\hello-purr
bower purescript-console#*      cached https://github.com/purescript/purescript-console.git#4.1.0
bower purescript-console#*    validate 4.1.0 against https://github.com/purescript/purescript-console.git#*
bower purescript-prelude#*      cached https://github.com/purescript/purescript-prelude.git#4.0.0
bower purescript-prelude#*    validate 4.0.0 against https://github.com/purescript/purescript-prelude.git#*
bower purescript-prelude#^4.0.0 cached https://github.com/purescript/purescript-prelude.git#4.0.0
bower purescript-prelude#^4.0.0         validate 4.0.0 against https://github.com/purescript/purescript-prelude.git#^4.0.0
bower purescript-effect#^2.0.0            cached https://github.com/purescript/purescript-effect.git#2.0.0
bower purescript-effect#^2.0.0          validate 2.0.0 against https://github.com/purescript/purescript-effect.git#^2.0.0
bower purescript-console#^4.1.0          install purescript-console#4.1.0
bower purescript-prelude#^4.0.0          install purescript-prelude#4.0.0
bower purescript-effect#^2.0.0           install purescript-effect#2.0.0

purescript-console#4.1.0 bower_components\purescript-console
├── purescript-effect#2.0.0
└── purescript-prelude#4.0.0

purescript-prelude#4.0.0 bower_components\purescript-prelude

purescript-effect#2.0.0 bower_components\purescript-effect
└── purescript-prelude#4.0.0
bower purescript-psci-support#* cached https://github.com/purescript/purescript-psci-support.git#4.0.0
bower purescript-psci-support#*         validate 4.0.0 against https://github.com/purescript/purescript-psci-support.git#*
bower purescript-psci-support#^4.0.0     install purescript-psci-support#4.0.0

purescript-psci-support#4.0.0 bower_components\purescript-psci-support
├── purescript-console#4.1.0
├── purescript-effect#2.0.0
└── purescript-prelude#4.0.0

没有运气:(

  纸浆测试
  纸浆制作

相同的错误 - 它找不到模块。 我错过了什么?请指教。 感谢

2 个答案:

答案 0 :(得分:3)

Purescript 0.12引入了更新版本的效果和控制台库,遗憾的是,尚未更新纸浆初始化以更正生成的示例以匹配(请参阅https://github.com/purescript-contrib/pulp/issues/337

只需将Main.purs中的代码更新为:

module Main where

import Prelude (Unit)
import Effect
import Effect.Console (log)

main :: Effect Unit
main = do
  log "Hello sailor!"`

开始使用。

答案 1 :(得分:0)

找到解决方案。

  1. 根本不需要凉亭
  2. 相反,有一个psc-package(另一个包管理器)
  3. 使用npm install -g psc-package
  4. 在我的Windows 10上没有正确安装

    目录${username}\AppData\Roaming\npm\node_modules\psc-package\vendor中没有psc-package.exe文件 因此,您需要修复install.js文件并替换

    ignore: ['psc-package']
    

    ignore: [bin.use()]
    

    然后使用

    运行固定安装
    ${username}\AppData\Roaming\npm\node_modules\psc-package\lib> node install
    

    之后,在vendor文件夹中,您可以找到psc-package.exe

    然后,我按照本教程: https://github.com/justinwoo/purescript-0.12.0-hello-world

    Build successful.
    look, show on Record:
    { apple: "banana" }