RyanZeng的编程随笔

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

最近在写C#,在使用Chocolatey安装ScriptCS(命令:choco install scriptcs)的过程中,出现以下报错:

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的包浏览网站发现一个排名靠前的chocolatey-core.extension包,猜想可能scriptcs用到了一些扩展的方法,果断安装了,即把报错解决了。

解决方案:

安装完choco后,先安装扩展包

choco install chocolatey-core.extension

再安装scriptcs

choco install scriptcs

 

posted on 2024-12-31 09:41  ryanzeng  阅读(72)  评论(0)    收藏  举报