2012-12-17 47 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