Spago repl fails to star

I feel quite dumb, but even with a very minimal setup [1], ‘spago repl’ fails on my computer with the following error:

$ spago repl
purs repl: PSCi requires the psci-support package.
For help getting started, visit https://github.com/purescript/documentation/blob/master/guides/PSCi.md
spago: callCommand: purs repl ".spago/console/v4.3.0/src/**/*.purs" ".spago/effect/v2.0.1/src/**/*.purs" ".spago/prelude/v4.1.1/src/**/*.purs" ".spago/psci-support/v4.0.0/src/**/*.purs" "src/**/*.purs" "test/**/*.purs"  (exit 1): failed

What am I doing wrong?

Do I really have to install Bower as pointed out here?

bower install purescript-psci-support

Thanks,

Giulio Cesare

[1]: These are the steps I have done to setup the project:

$ nvm install --lts
[…]
Now using node v12.14.1 (npm v6.13.4)

$ npm install -g purescript
[…]
+ purescript@0.13.6
added 154 packages from 89 contributors in 6.11s

$ npm install -g spago
[…]
+ spago@0.13.1
added 57 packages from 60 contributors in 4.357s

$ spago init
[…]
[info] Set up a local Spago project.
[info] Try running `spago build`

I have tried to follow the suggestion to install ‘purescript-psci-support’ with Bower, but to no avail:

$ npm install -g bower
npm WARN deprecated bower@1.8.8: We don't recommend using Bower for new projects. Please consider Yarn and Webpack or Parcel. You can read how to migrate legacy project here: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
[…]
+ bower@1.8.8
added 1 package from 1 contributor in 1.132s

$ bower install purescript-psci-support
bower purescript-psci-support#*       not-cached https://github.com/purescript/purescript-psci-support.git#*
bower purescript-psci-support#*          resolve https://github.com/purescript/purescript-psci-support.git#*
bower purescript-psci-support#*         download https://github.com/purescript/purescript-psci-support/archive/v4.0.0.tar.gz
bower purescript-psci-support#*          extract archive.tar.gz
bower purescript-psci-support#*         resolved https://github.com/purescript/purescript-psci-support.git#4.0.0
bower purescript-console#^4.0.0       not-cached https://github.com/purescript/purescript-console.git#^4.0.0
bower purescript-console#^4.0.0          resolve https://github.com/purescript/purescript-console.git#^4.0.0
bower purescript-prelude#^4.0.0           cached https://github.com/purescript/purescript-prelude.git#4.1.0
bower purescript-prelude#^4.0.0         validate 4.1.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.1
bower purescript-effect#^2.0.0          validate 2.0.1 against https://github.com/purescript/purescript-effect.git#^2.0.0
bower purescript-console#^4.0.0         download https://github.com/purescript/purescript-console/archive/v4.4.0.tar.gz
bower purescript-prelude#^4.0.0              new version for https://github.com/purescript/purescript-prelude.git#^4.0.0
bower purescript-prelude#^4.0.0          resolve https://github.com/purescript/purescript-prelude.git#^4.0.0
bower purescript-prelude#^4.0.0         download https://github.com/purescript/purescript-prelude/archive/v4.1.1.tar.gz
bower purescript-prelude#^4.0.0          extract archive.tar.gz
bower purescript-console#^4.0.0          extract archive.tar.gz
bower purescript-console#^4.0.0         resolved https://github.com/purescript/purescript-console.git#4.4.0
bower purescript-prelude#^4.0.0         resolved https://github.com/purescript/purescript-prelude.git#4.1.1
bower purescript-psci-support#^4.0.0     install purescript-psci-support#4.0.0
bower purescript-effect#^2.0.0           install purescript-effect#2.0.1
bower purescript-console#^4.0.0          install purescript-console#4.4.0
bower purescript-prelude#^4.0.0          install purescript-prelude#4.1.1

purescript-psci-support#4.0.0 bower_components/purescript-psci-support
├── purescript-console#4.4.0
├── purescript-effect#2.0.1
└── purescript-prelude#4.1.1

purescript-effect#2.0.1 bower_components/purescript-effect
└── purescript-prelude#4.1.1

purescript-console#4.4.0 bower_components/purescript-console
├── purescript-effect#2.0.1
└── purescript-prelude#4.1.1

purescript-prelude#4.1.1 bower_components/purescript-prelude

The final outcome is unfortunately very similar. :frowning:

$ spago repl
purs repl: PSCi requires the psci-support package.
For help getting started, visit https://github.com/purescript/documentation/blob/master/guides/PSCi.md
spago: callCommand: purs repl ".spago/console/v4.3.0/src/**/*.purs" ".spago/effect/v2.0.1/src/**/*.purs" ".spago/prelude/v4.1.1/src/**/*.purs" ".spago/psci-support/v4.0.0/src/**/*.purs" "src/**/*.purs" "test/**/*.purs"  (exit 1): failed

You don’t have to install Bower - you just have to install psci-support with whichever package manager you’re using (so spago in this case). We should update that errormessage, it’s misleading.

1 Like

Indeed; I just had to add “psci-support” to the ‘dependencies’ in spago.dhall.
It feels weird, as this is not a dependency useful for the project itself, but at least I can use the repl now.

THANKS!

1 Like

Happy to hear this is solved! :tada:

I guess we could also check that the psci-support is installed before starting a repl. I opened an issue in Spago to track this

2 Likes

Having had a closer look I think that it’s not actually the error message which is misleading, but the README for the psci-support package, which only suggests Bower as an installation method. I’m sure it also doesn’t help that the guide linked in the error message, https://github.com/purescript/documentation/blob/master/guides/PSCi.md, assumes you’re using Pulp and Bower.

Perhaps we should start removing the “installation” sections on package readmes?