With tools like npm we can install a specific version
npm install [email protected]
How do you install a specific version using spago install?
With tools like npm we can install a specific version
npm install [email protected]
How do you install a specific version using spago install?
Firstly, that's not what
spago installdoes. Instead of "adding a package to your project",spago installdownloads all packages that are currently referenced in yourspago.dhallfile.Secondly, the idea with Spago is that you don't choose a specific package version. Instead what you choose is a "snapshot", which is a collection of certain versions of all available packages that are guaranteed to compile and work together. This is a measure intended to prevent version conflicts and versioning hell (and this is similar to how Haskell
stackworks)The snapshot is defined in your
packages.dhallfile, and then you specify the specific packages that you want to use inspago.dhall. The version for each package comes from the snapshot.But if you really need to install a very specific version of a package, and you really know what you're doing, then you can modify the snapshot itself, which is described in
packages.dhall.By default your
packages.dhallfile might look something like this:This is the default template that you get after running
spago new.In order to override the version for a specific package, add it to the
overridesmap like this:And then run
spago install. Spago should pull in version1.2.0of thefoopackage for you.