Solucionado (ver solução)
Solucionado
(ver solução)
6
respostas

Erro ao instalar o Chocolatey no Win10

Amigos, boa tarde!

Estou executando a instalação do chocolatey via PowerShell e no processo de instalação tenho o Warning abaixo. Parece que está faltando um arquivo na pasta do PowerShell mas eu não sei como fazer isso. Conto com a ajuda de vocês.

PS C:\WINDOWS\system32> [System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCred entials; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) Getting latest version of the Chocolatey package for download. Downloading https://chocolatey.org/api/v2/package/chocolatey/0.10.3 to C:\Users\diego\AppData\Local\Temp\chocolatey\choc Install\chocolatey.zip Extracting C:\Users\diego\AppData\Local\Temp\chocolatey\chocInstall\chocolatey.zip to C:\Users\diego\AppData\Local\Temp\ chocolatey\chocInstall... Installing chocolatey on this machine Creating ChocolateyInstall as an environment variable (targeting 'Machine') Setting ChocolateyInstall to 'C:\ProgramData\chocolatey' WARNING: It's very likely you will need to close and reopen your shell before you can use choco. Restricting write permissions to Administrators We are setting up the Chocolatey package repository. The packages themselves go to 'C:\ProgramData\chocolatey\lib' (i.e. C:\ProgramData\chocolatey\lib\yourPackageName). A shim file for the command line goes to 'C:\ProgramData\chocolatey\bin' and points to an executable in 'C:\ProgramData\chocolatey\lib\yourPackageName'.

Creating Chocolatey folders if they do not already exist.

WARNING: You can safely ignore errors related to missing log files when upgrading from a version of Chocolatey less than 0.9.9. 'Batch file could not be found' is also safe to ignore. 'The system cannot find the file specified' - also safe. AVISO: Not setting tab completion: Profile file does not exist at 'C:\Users\diego\OneDrive\Documentos\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'. Chocolatey (choco.exe) is now ready. You can call choco from anywhere, command line or powershell by typing choco. Run choco /? for a list of functions. You may need to shut down and restart powershell and/or consoles first prior to using choco. Ensuring chocolatey commands are on the path Ensuring chocolatey.nupkg is in the lib folder

6 respostas

Qual o erro exato que você se refere? Todos os avisos são sobre erros que são seguros de ignorar. Você consegue executar o comando no PowerShell após a tentativa de instalação? Lembre-se de reiniciar o PowerShell após instalar o Chocolatey.

Ian,

Eu me refiro a mensagem abaixo.

WARNING: You can safely ignore errors related to missing log files when upgrading from a version of Chocolatey less than 0.9.9. 'Batch file could not be found' is also safe to ignore. 'The system cannot find the file specified' - also safe. AVISO: Not setting tab completion: Profile file does not exist at 'C:\Users\diego\OneDrive\Documentos\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'.

Após a instalação eu reinicio o powershell e entro no cmd para executar o chocolatey. Digito "choco" e aparece a mensagem abaixo.

C:\Users\diego>choco This is try 1/3. Retrying after 300 milliseconds. Error converted to warning: O acesso ao caminho 'C:\ProgramData\chocolatey\config' foi negado. This is try 2/3. Retrying after 400 milliseconds. Error converted to warning: O acesso ao caminho 'C:\ProgramData\chocolatey\config' foi negado. Maximum tries of 3 reached. Throwing error. Cannot create directory "C:\ProgramData\chocolatey\config". Error was: System.UnauthorizedAccessException: O acesso ao caminho 'C:\ProgramData\chocolatey\config' foi negado. em System.IO.Error.WinIOError(Int32 errorCode, String maybeFullPath) em System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost) em System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost) em chocolatey.infrastructure.filesystem.DotNetFileSystem.<>cDisplayClass60.b5f() em chocolatey.infrastructure.tolerance.FaultTolerance.<>cDisplayClass1.b__0() em chocolatey.infrastructure.tolerance.FaultTolerance.retry[T](Int32 numberOfTries, Func`1 function, Int32 waitDurationMilliseconds, Int32 increaseRetryByMilliseconds, Boolean isSilent) em chocolatey.infrastructure.filesystem.DotNetFileSystem.create_directory(String directoryPath) em chocolatey.infrastructure.filesystem.DotNetFileSystem.create_directory_if_not_exists(String directoryPath, Boolean ignoreError) O acesso ao caminho 'C:\ProgramData\chocolatey\config' foi negado.

solução!

Acabo de instalar o Chocolatey via PowerShell no Windows 10 pelo comando:

iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex

E recebi a seguinte resposta (bem similar a sua):

PS C:\Windows\system32> iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
Getting latest version of the Chocolatey package for download.
Downloading https://chocolatey.org/api/v2/package/chocolatey/0.10.3 to C:\Users\iannp\AppData\Local\Temp\chocolatey\choc
Install\chocolatey.zip
Extracting C:\Users\iannp\AppData\Local\Temp\chocolatey\chocInstall\chocolatey.zip to C:\Users\iannp\AppData\Local\Temp\
chocolatey\chocInstall...
Installing chocolatey on this machine
Creating ChocolateyInstall as an environment variable (targeting 'Machine')
  Setting ChocolateyInstall to 'C:\ProgramData\chocolatey'
WARNING: It's very likely you will need to close and reopen your shell
  before you can use choco.
Restricting write permissions to Administrators
We are setting up the Chocolatey package repository.
The packages themselves go to 'C:\ProgramData\chocolatey\lib'
  (i.e. C:\ProgramData\chocolatey\lib\yourPackageName).
A shim file for the command line goes to 'C:\ProgramData\chocolatey\bin'
  and points to an executable in 'C:\ProgramData\chocolatey\lib\yourPackageName'.

Creating Chocolatey folders if they do not already exist.

WARNING: You can safely ignore errors related to missing log files when
  upgrading from a version of Chocolatey less than 0.9.9.
  'Batch file could not be found' is also safe to ignore.
  'The system cannot find the file specified' - also safe.
PATH environment variable does not have C:\ProgramData\chocolatey\bin in it. Adding...
AVISO: Not setting tab completion: Profile file does not exist at
'C:\Users\iannp\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'.
Chocolatey (choco.exe) is now ready.
You can call choco from anywhere, command line or powershell by typing choco.
Run choco /? for a list of functions.
You may need to shut down and restart powershell and/or consoles
 first prior to using choco.
Ensuring chocolatey commands are on the path
Ensuring chocolatey.nupkg is in the lib folder

Acrescento que o software está funcionando normal, pois ao executar o comando Chocolatey no PS recebo a resposta:

Chocolatey v0.10.3

Estás executando o PowerShell via administrador? Poderia checar suas variáveis de ambientes e olhar a correspondente a do chocolatey? Execute também 'chocolatey' no PS, pode ser um problema na variável de ambiente.

Ian,

Fiz a instalação seguindo a sua, e consegui.

PS C:\WINDOWS\system32> choco Chocolatey v0.10.3

Obrigado, Amigo!

Por nada!