百度经验里面安装Chocolatey出现以下错误,可能是安装方法有问题。试了好几次不行
Error: Can not open file as archive
Installing chocolatey on this machine
& : 无法将“C:\Users\sucy\AppData\Local\Temp\chocolatey\chocInstall\tools\chocolateyInstall.ps1”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称
的拼写,如果包括路径,请确保路径正确,然后再试一次。
所在位置 行:161 字符: 3
+ & $chocInstallPS1
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Users\sucy\A...ateyInstall.ps1:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Ensuring chocolatey commands are on the path
Ensuring chocolatey.nupkg is in the lib folder
找啊找啊,作为程序员,科学上网真的不可少啊!!
最后找到这个是正确的 :
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin