Installation fails on windows 10 because of spaces in the user name
- OS: Windows 10.
- Create a user
te st
with a name containing a space, and log in using it. - Install ghcup using the method described at https://www.haskell.org/ghcup/# (we need to choose
To install on Windows
variant with a PowerShell code snippet). - Select default installation paths - press Enter twice when the installer asks questions.
- Choose to install HLS, stack, and msys2.
- Installation fails during msys2 extraction stage, see the screenshot (it's partially in Russian, but you can find translation into English below):
The error message is:
Remove-Item: An object at the specified path C:\Users\TEST~1 does not exist.
Line:415 Col:5
+ Remove-Item -Path ('{0}/{1}' -f $env:TEMP, $archive)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : Invalid argument: (:) [Remove-Item], PSArgumentException
+ FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.RemoveItemCommand
Maybe the value of TEMP
environment variable will help (got using cmd
):
C:\Users\te st>echo %TEMP%
C:\Users\TEST~1\AppData\Local\Temp
I didn't check it but I guess that non-latin characters in the user name might cause a similar issue. I will try to check it later.
Maybe a user name containing a space is not a good idea, but Windows perfectly allows them, and it does not exclude spaces from the user profile folder name (as Mac OS X does, AFAIK). It's not apparent for newbies trying to learn Haskell in Windows how to solve the installation issue.