'VSCode Haskell Extension Error: `ghcup --no-verbose upgrade` exited with exit code ENOENT

When opening a Haskell file with VSCodium (I don't think that makes a difference), I get the error `ghcup --no-verbose upgrade` exited with exit code ENOENT.

Here's the full log from the Extension Output:

[client] INFO Finding haskell-language-server
[client] INFO Checking for ghcup installation
[client] INFO found ghcup at ghcup
[client] INFO Executing 'ghcup --no-verbose upgrade' in cwd '/home/lonelyfloat'
[client] ERROR Error executing 'ghcup --no-verbose upgrade' with error code ENOENT
[client] ERROR stderr: 
[client] ERROR Error executing 'ghcup --no-verbose upgrade': name = Error, message = spawn ghcup ENOENT
[client] ERROR Internal Error: `ghcup --no-verbose upgrade` exited with exit code ENOENT.
                              Consult the [Extensions Output](https://github.com/haskell/vscode-haskell#investigating-and-reporting-problems)
                              for details.
[client] ERROR Error: `ghcup --no-verbose upgrade` exited with exit code ENOENT.
                              Consult the [Extensions Output](https://github.com/haskell/vscode-haskell#investigating-and-reporting-problems)
                              for details.

When I just run ghcup --no-verbose upgrade in the terminal, I just get a warning saying that GHCup is up to date.



Solution 1:[1]

In my case, it was the PATH problem as explained here https://githubmemory.com/repo/haskell/vscode-haskell/issues/581

Quitting the vscode completely and then re-opening it fixed the issue.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ashkan Kh. Nazary