Error install.ps1 | $cacheDir Line 97
Closed this issue · 1 comments
Getting error:
New-Item : Illegal characters in path. At C:\Users\User\install.ps1:97 char:13 +New-Item -Path "$cacheDir" -ItemType "directory" -Force | ... +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (C:\Users\User...0\",\"status\"::String) [New-Item], ArgumentException + FullyQualifiedErrorId : ItemExistsArgumentError,Microsoft.PowerShell.Commands.NewItemCommand
It appears the $cacheDir variable is the responsible for this issue:
Cache Directory: C:\Users\User\nvm\cache\Node.js®"}],"\n",["$","$L15",null,{"currentStart":"2023-04-18","ltsStart":"2023-10-24","maintenanceStart":"2024-10-22","endOfLife":"2026-04-30","status":"Acti...
I got the same issue this morning.
I think the root cause is function function getLtsVersion()
in .psl
file, parse the NodeJS website improperly. Although the scripts surround by try/catch
.
So that, I just changedfunction getLtsVersion()
return value to “v12.13.0” (or other version), and it worked perfectly.