最近在寫C#,在使用Chocolatey安裝ScriptCS(命令:choco install scriptcs)的過程中,出現(xiàn)以下報錯:
ERROR: The term 'Write-ChocolateyFailure' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
The install of scriptcs was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\ScriptCs\tools\chocolateyInstall.ps1'.
See log for details.
嘗試升級choco無果后,在choco的包瀏覽網(wǎng)站發(fā)現(xiàn)一個排名靠前的chocolatey-core.extension包,猜想可能scriptcs用到了一些擴展的方法,果斷安裝了,即把報錯解決了。
解決方案:
安裝完choco后,先安裝擴展包
choco install chocolatey-core.extension
再安裝scriptcs
choco install scriptcs
浙公網(wǎng)安備 33010602011771號