I have just installed Chocolatey (as I think, I'm not familiar with cmd-stuff) to my Windows 10 and I'm getting an error using choco keyword that says:
...Maximum tries of 3 reached. Throwing error. Cannot create directory "C:\ProgramData\chocolatey\config"...
And it says something that the usage of the path "C:\ProgramData\chocolatey\config" is prevented.
When I navigate to the path "C:\ProgramData\chocolatey", "config" directory obviously doesn't exist. What should I do to get the chocolatey to work?
Full error info:
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. Kaikki oikeudet pidätetään.
C:\xampp\htdocs\opettelu\react>cd C:\
C:\>choco install atom
This is try 1/3. Retrying after 300 milliseconds.
Error converted to warning:
Polun C:\ProgramData\chocolatey\config käyttäminen on estetty.
This is try 2/3. Retrying after 400 milliseconds.
Error converted to warning:
Polun C:\ProgramData\chocolatey\config käyttäminen on estetty.
Maximum tries of 3 reached. Throwing error.
Cannot create directory "C:\ProgramData\chocolatey\config". Error was:
System.UnauthorizedAccessException: Polun C:\ProgramData\chocolatey\config käyttäminen on estetty.
kohteessa System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
kohteessa System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
kohteessa System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
kohteessa chocolatey.infrastructure.filesystem.DotNetFileSystem.<>c__DisplayClass60.<create_directory>b__5f()
kohteessa chocolatey.infrastructure.tolerance.FaultTolerance.<>c__DisplayClass1.<retry>b__0()
kohteessa chocolatey.infrastructure.tolerance.FaultTolerance.retry[T](Int32 numberOfTries, Func`1 function, Int32 waitDurationMilliseconds, Int32 increaseRetryByMilliseconds, Boolean isSilent)
kohteessa chocolatey.infrastructure.filesystem.DotNetFileSystem.create_directory(String directoryPath)
kohteessa chocolatey.infrastructure.filesystem.DotNetFileSystem.create_directory_if_not_exists(String directoryPath, Boolean ignoreError)
Polun C:\ProgramData\chocolatey\config käyttäminen on estetty.
C:\>
Thanks.
To verify that Chocolatey is installed, we will use the choco command. C:\WINDOWS\system32>choco Chocolatey v0. 10.15 Please run 'choco -? ' or 'choco -?
Run Chocolatey from an administrative command prompt - you are running into UAC issues. The first time Chocolatey runs, it needs to create the config file. Some commands you won't need administrative command prompt to have, but the first time it is particularly required.
The reason the install process doesn't run it once to create those things is that .NET Framework 4.x may have just been installed and require a reboot prior to using choco.exe. In those instances it would have a modal dialog pop up mentioning the issue and required reboot, which is unacceptable for automation purposes.
Run the command as administrator
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With