I recently released a package and tried using it in an old project. After trying to elm install
the package I got the following error:
-- UNKNOWN PACKAGE -------------------------------------------------------------
I cannot find a package named name/package.
I could not connect to https://package.elm-lang.org though, so new packages may
have been published since I last updated my local cache of package names.
Looking through the locally cached names, the closest ones are:
name1/package1
name2/package2
name3/package3
name4/package4
Maybe you want one of these instead?
It seemed related to: Elm init tls issue
A fix was merged: elmPackages.elm: Fix runtime TLS connection to package.elm-lang.org by turboMaCk · Pull Request #414495 · NixOS/nixpkgs · GitHub . However, my devbox.lock
for the project had an older version of the compiler.
"elmPackages.elm@latest": {
"last_modified": "2025-05-06T08:06:31Z",
"resolved": "github:NixOS/nixpkgs/1cb1c02a6b1b7cf67e3d7731cbbf327a53da9679#elmPackages.elm",
"source": "devbox-search",
"version": "0.19.1",
"systems": {
...
}
}
That version didn’t have the fix: nixpkgs/pkgs/development/compilers/elm/packages/ghc9_6/default.nix at 1cb1c02a6b1b7cf67e3d7731cbbf327a53da9679 · NixOS/nixpkgs · GitHub
However, I checked elmPackages.elm | How to install with Nix or Devbox and the latest version found there did have the fix: nixpkgs/pkgs/development/compilers/elm/packages/ghc9_6/default.nix at a421ac6595024edcfbb1ef950a3712b89161c359 · NixOS/nixpkgs · GitHub
So, I updated elmPackages.elm
in my devbox.lock
.
devbox update elmPackages.elm
And, it solved the issue. Just sharing in case it could help someone else.