purescript / psc-package

A package manager for PureScript based on package sets
https://psc-package.readthedocs.io
Other
229 stars 45 forks source link

Unable to parse packages.json: Error in $: not enough input. (solution proposed) #157

Closed davedawkins closed 4 years ago

davedawkins commented 5 years ago

Windows 10, latest psc-package, latest npm, etc. Can be reproduced by:

$ git clone https://github.com/dwhitney/purescript-book.git
$ cd purescript-book/exercises/chapter03
$ psc-package install
Unable to parse packages.json: Error in $: not enough input.

I found that removing the \r from packages.json would fix it.

I then decided to try and debug psc-package. Eventually I found that updating to lts-14.1 (and aeson-pretty to 0.8.8) fixes the issue (without having to strip \r).

I'm a git noob and don't yet know how to create a pull request. The only file that needs changing is stack.yaml:

resolver: lts-14.1
packages:
- '.'
extra-deps:
- aeson-pretty-0.8.8 # newer in lts-14.1 needed for formatting packages.json

If you want, I'll try to create a PR, but let me know.

davedawkins commented 5 years ago

Update: Author of purescript-book that I used for my test case has updated to spago, so although the fix is still required, the test case is no longer valid.

justinwoo commented 4 years ago

I'll have to try this out soon, since some other Windows users also seem to have this issue. Maybe it has to do with what git config is being picked up and used.