Should I be able to run `gleam build` succesfully when downloading an exercise?

When I download an exercise using exercism download --exercise=two-fer --track=gleam and then run gleam build in the directory it downloaded to I get the following compiler error:

PS C:\Users\aage\Exercism\gleam\two-fer> gleam build
Downloading packages
 Downloaded 3 packages in 0.52s
  Compiling gleam_stdlib
error: Syntax error
    ┌─ build\packages\gleam_stdlib\src\gleam\dynamic.gleam:332:22
    │
332 │     use inner_result <- result.then(decode_result(value))
    │                      ^ This operator has no value on its right side.

Hint: Remove it or put a value after it.

Am I doing something wrong?

  • Running on VSCode in Windows 10
  • This is the output of gleam --version: gleam 0.22.1

Hey aage,

This error shouldn’t happen. The exercise requires a stdlib version of at least 0.26.0. The manifest.toml locks in 0.27.0. The manifest acts like a .lockfile in Node/JavaScript. The error you’re getting is caused by the older version of Gleam failing to build the newer standard library.
See Installing Gleam – Gleam for installation information. I personally like using the asdf version manager, on Windows it might be easier to use the prebuilt binary.

Hope that helps. :)

Edit: Was confused in my first response, thank you to lpil for clearing things up.

Thank you for your response!

I tried running choco upgrade gleam but that doesn’t update anything; “gleam v0.22.1 is the latest version available based on your source(s).”

I’ll look into the other options you mentioned!

Many great success!

I uninstalled via chocolatey and then added the prebuild .exe to my path on Windows.

Thank you!

The latest version of Gleam is in review on chocolatey because it got flagged by one antivirus vendor, should hopefully be sorted out soon: