Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

chocholatey packages not found, PATH not set #2

Open
StefanScherer opened this issue Jul 5, 2015 · 7 comments
Open

chocholatey packages not found, PATH not set #2

StefanScherer opened this issue Jul 5, 2015 · 7 comments

Comments

@StefanScherer
Copy link

I played with the latest Windows 10 Build 10162 and tried the "OOBE" of the built-in package manager. I tried installing a command line tool on a fresh Windows installation.

Install-Package docker

First the nuget provider will be installed.
After repeating the Install-Package docker command it installs the Chocolatey package.
But the command line tools could not be started as it is not found in PATH.

Here is the output of my shell:

Windows PowerShell
Copyright (C) 2015 Microsoft Corporation. All rights reserved.

PS C:\Windows\system32> Install-Package docker

The provider 'nuget v2.8.5.122' is not installed.
nuget may be manually downloaded from https://oneget.org/nuget-anycpu-2.8.5.122.exe and installed.
Would you like PackageManagement to automatically download and install 'nuget' now?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"):
Install-Package : No match was found for the specified search criteria and package name 'docker'.
At line:1 char:1
+ Install-Package docker
+ ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Ex
   ception
    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

PS C:\Windows\system32> Install-Package docker

The package(s) come from a package source that is not marked as trusted.
Are you sure you want to install software from 'chocolatey'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): Y

Name                           Version          Source           Summary
----                           -------          ------           -------
docker                         1.7.0            chocolatey       Docker is an open platform for developers and sysad...


PS C:\Windows\system32> docker
docker : The term 'docker' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ docker
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (docker:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Windows\system32> $env:path
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\

Even after signing out and signing in again the PATH is still the same and the command line tool could not be found.

The environment variable ChocolateyPath is set for the current user, but the PATH is not set:

bildschirmfoto 2015-07-05 um 07 33 03

I have found the installed package at the usual place:

PS C:\Windows\system32> dir C:\Chocolatey\lib\

    Directory: C:\Chocolatey\lib

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----         7/5/2015   6:24 AM                docker.1.7.0

PS C:\Windows\system32> dir C:\Chocolatey\bin

    Directory: C:\Chocolatey\bin

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----         7/5/2015   6:24 AM            100 docker.bat

Is there a way to set PATH for the user as well?

PS: I used this boxcutter/windows PR#25 to create the Windows 10 Vagrant basebox for the tests.

@patsissons
Copy link

I have run into the same issue with the git and chocolatey packages. the install happens just fine, but the PATH modification doesn't occur.

@villasv
Copy link

villasv commented Sep 18, 2015

I faced the same issue in the beginning. Make sure you PowerShell instance has execution policy for executing scripts.

If Get-Executionpolicy returns Restricted, you can change it by running
Set-Executionpolicy Unrestricted -Scope CurrentUser

Then I uninstalled git and tried again, it worked fine. Probably this happens because Chocolatey downloads a ps script file and fails to execute it silently.

@ferventcoder
Copy link
Contributor

Howdy. I just turned on watching for this repo. Apologies that I had not previously seen this.

@ferventcoder
Copy link
Contributor

What @villasv mentioned here.

@StefanScherer
Copy link
Author

@ferventcoder Thanks for watching.

In my VM Get-Executionpolicy returns RemoteSigned.

I've replayed it in a Windows 10 Insider Preview 10565 but even with Set-Executionpolicy I have no luck at the moment:

Windows PowerShell
Copyright (C) 2015 Microsoft Corporation. All rights reserved.

PS C:\Users\vagrant> Set-Executionpolicy Unrestricted -Scope CurrentUser

Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
http://go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): y
PS C:\Users\vagrant> Get-Executionpolicy
Unrestricted
PS C:\Users\vagrant> Install-Package docker

The provider 'nuget v2.8.5.127' is not installed.
nuget may be manually downloaded from https://oneget.org/nuget-anycpu-2.8.5.127.exe and installed.
Would you like PackageManagement to automatically download and install 'nuget' now?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"):
Install-Package : No match was found for the specified search criteria and package name 'docker'.
At line:1 char:1
+ Install-Package docker
+ ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Ex
   ception
    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

PS C:\Users\vagrant> Install-Package docker
Install-Package : No match was found for the specified search criteria and package name 'docker'.
At line:1 char:1
+ Install-Package docker
+ ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Ex
   ception
    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

PS C:\Users\vagrant>

@philippgille
Copy link

philippgille commented May 14, 2017

Is this related to chocolatey/choco#1052?

There are also two StackOverflow questions where setting the execution policy to RemoteSigned worked:

But it didn't work for me. I created my own Chocolatey package (a "hello world" .NET Core console app, published as self-contained deployment, copied all published files to the tools directory) and uploaded to MyGet.

When running choco install my-app.portable --source https://www.myget.org/F/my-feed/ everything works fine.
When running install-Package my-app.portable -Source https://www.myget.org/F/my-feed -provider chocolatey I can see the app in C:\Chocolatey\lib, and there's a .bat file in C:\Chocolatey\bin, but C:\Chocolatey\bin isn't in the PATH.

The app isn't signed, so I tried with execution policy Unrestricted as well, but to no avail.

@ferventcoder
Copy link
Contributor

I see you left a comment at #5. I will follow up there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants