2012-12-17 42 views
2

我一直有这个问题一段时间。我已经安装的版本是0.9.8.11。RuntimeException当更新巧克力

PS C:\Chocolatey\lib> cver 
The most recent version of chocolatey available from (https://go.microsoft.com/f 
wlink/?LinkID=206669) is 0.9.8.20. On your machine you have 0.9.8.11 installed. 

Name       Value 
----       ----- 
found       0.9.8.11 
foundCompare     00000.00009.00008.00011 
latest       0.9.8.20 
latestCompare     00000.00009.00008.00020 

我每次运行命令cupcup all,我得到以下错误:

The expression after '&' in a pipeline element produced a object that was not valid. It  must result in a command name, script block or CommandInfo object. At  C:\Nuget\chocolateyInstall\helpers\chocolateyInstaller.psm1:446 char:4 
+  & $oc @PSBoundParameters 
+   
    + CategoryInfo   : InvalidOperation: (:) [], RuntimeException 
    + FullyQualifiedErrorId: BadExpression 

这里是输出运行cup时:

PS C:\Chocolatey\lib> cup 
The most recent version of chocolatey available from (https://go.microsoft.com/f 
wlink/?LinkID=206669) is 0.9.8.20. On your machine you have 0.9.8.11 installed. 
===================================================== 
Chocolatey (0.9.8.11) is installing chocolatey (from https://go.microsoft.com/fw 
link/?LinkID=206669) to "C:\NuGet\lib" 
===================================================== 
Package License Acceptance Terms 
------------------------- 
Please run chocolatey /? for full license acceptance verbage. By installing you 
accept the license for the package you are installing... 
------------------------- 
------------------------- 
NuGet 
------------------------- 
'chocolatey 0.9.8.20' already installed. 

------------------------- 
------------------------- 
Chocolatey Runner (CHOCOLATEY) 
------------------------- 
------------------------- 
Chocolatey Installation (chocolateyinstall.ps1) 
------------------------- 
Looking for chocolateyinstall.ps1 in folder C:\NuGet\lib\chocolatey.0.9.8.20 
If chocolateyInstall.ps1 is found, it will be run. 
------------------------- 
Running powershell -NoProfile -ExecutionPolicy unrestricted -Command "& import-m 
odule -name 'C:\NuGet\chocolateyInstall\helpers\chocolateyInstaller.psm1'; & 'C 
:\NuGet\lib\chocolatey.0.9.8.20\tools\chocolateyInstall.ps1'". This may take awh 
ile and permissions may need to be elevated, depending on the package. 
------------------------- 
Executable Batch Links 
------------------------- 
Looking for executables in folder: C:\NuGet\lib\chocolatey.0.9.8.20 
Adding batch files for any executables found to a location on PATH. In other wor 
ds the executable will be available from ANY command line/powershell prompt. 
------------------------- 
Adding C:\NuGet\bin\NuGet.bat and pointing to C:\NuGet\lib\chocolatey.0.9.8.20\t 
ools\chocolateyInstall\NuGet.exe 
------------------------- 
===================================================== 
Chocolatey has finished installing chocolatey 
===================================================== 

我曾尝试删除的巧克力并再次安装。仍然是同样的事情。

我也尝试删除C:\Chocolatey\lib\里面的巧克力目录并再次运行cup,仍然是相同的错误。

我PowerShell的版本是3.0

PS C:\Chocolatey\lib> get-host 

Name    : ConsoleHost 
Version   : 3.0 
InstanceId  : 934a43a4-0ccf-47e3-a59a-650f1cf4c6d0 
UI    : System.Management.Automation.Internal.Host.InternalHostUserI 
        nterface 
CurrentCulture : en-MY 
CurrentUICulture : en-US 
PrivateData  : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy 
IsRunspacePushed : False 
Runspace   : System.Management.Automation.Runspaces.LocalRunspace 

回答

1

如果所有的东西出问题,最好的解决方法是删除并重新安装。那是我以前做的。但我没有删除那个时间是C:\NuGet文件夹。删除C:\ChocolateyC:\NuGet文件夹后,我再次安装了Chocolatey,这次运行cup时没有错误,而且Chocolatey现在处于最新版本 - 0.9.8.20。

+0

太棒了!可能要参考这个小组的讨论。 – ferventcoder

+0

https://groups.google.com/forum/?fromgroups=#!topic/chocolatey/_h8o0u8KqVo – ferventcoder