Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nuget push Cannot prompt for input in non-interactive mode

Tags:

nuget

I am running this command

nuget push Package.1.0.0.0.nupkg -s http://mysource.com/ xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -ConfigFile ..\..\.nuget\nuget.config

I receive this error

UserName: Cannot prompt for input in non-interactive mode.

I have specified the nuget.config file which has the username and cleartextpassword like this

  <packageSources>
    <add key="NuGet official package source" value="http://www.nuget.org/api/v2" />
    <add key="https://www.nuget.org/api/v2/" value="https://www.nuget.org/api/v2/" />
    <add key="PackageName" value="http://mysource.com/nuget" />
  </packageSources>

....    

  <packageSourceCredentials>
    <PackageName>
      <add key="Username" value="<username>" />
      <add key="ClearTextPassword" value="<clearpassword>" />
    </PackageName>
  </packageSourceCredentials>

Why doesn't this work? I am running the batch file from within VS2013 the nuget version I am using is, NuGet Version: 2.8.50926.602

like image 372
Paul Avatar asked Jan 04 '15 23:01

Paul


3 Answers

The only way I could make this work right now was based on this post from Robin Osborne.

  • I took the source URL (http://mysource.com/nuget) and visited it directly using iexplore
  • Windows asked me for authentication credentials, I entered them manually and asked Windows to save the password (this will store them in the user's Window Credentials store).
  • I then rerun the PS1 script that did the nuget push operation and it didn't complain at all.

Of course, this is not how it's intended to work, but at least it unblocked me from the same situation you were experiencing. Treat it as a workaround.

like image 200
Alpha Avatar answered Nov 18 '22 10:11

Alpha


This is not for using the nuget.config file but I had the same problem just running the command line PUSH...

Go to your VSTS website and click the Package link. If you have a feed, click the Connect to feed link. If not, the same link/button will be present on the screen. Click Generate NuGet credentials. Copy the command and paste it into VS PM Console window. Then follow instruction #3 on the page and it works inside VS.

like image 20
Kris Kilton Avatar answered Nov 18 '22 11:11

Kris Kilton


Don't know if this will help but. I had the same error when trying to push to our private Klondike server. We fixed this by using a valid ApiKey rather than modifying the config.

like image 1
Steve Avatar answered Nov 18 '22 10:11

Steve