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

npm install prompting me for a password on CentOS when installing from github #3956

Closed
fresheneesz opened this issue Oct 1, 2013 · 5 comments
Labels

Comments

@fresheneesz
Copy link

I'm running the following command:

npm install git+https://git@github.com/fresheneesz/buildModules.git#2f50ea0830b0fa580c087b4bfa947de2e7b7d7c3

It immediately shows me a password prompt. If I type in my github password, it seems to accept it and finishes the installation. I shouldn't have to enter a password just to install it, right?

@smikes
Copy link
Contributor

smikes commented Nov 17, 2014

Is this still a problem for you?

I believe this is just git prompting you for your password as it normally would if you try to access your repository securely (git+https). You can use git credential cache (see http://git-scm.com/docs/git-credential-cache ) if you want to enter your password less frequently. Another option is to use ssh keys and repo names of the style git@github.com:fresheneesz/proto.git

We are trying to clean up older npm issues, so if we don't hear back from you within a week, we will close this issue. (Don't worry -- you can always come back again and re-open it!)

Thanks!

@fresheneesz
Copy link
Author

Yes indeed, this is still happening. Github is always https, and https has nothing to do with requiring or not requiring a password.

@smikes
Copy link
Contributor

smikes commented Nov 17, 2014

Right, it's not the https, it's the git protocol that wants your password--

Github documentation - https://help.github.com/articles/which-remote-url-should-i-use/

When you git fetch, git pull, or git push to the remote repository using HTTPS, you'll be asked for your GitHub username and password.

You would need to clone your code to a repository that allows anonymous git access (apparently github does not) or else publish your module to the npm registry if you want a passwordless, non-authenticated install.

@fresheneesz
Copy link
Author

Hmm, interesting. I guess that solve that mystery. Thanks!

For anyone who might be running across this problem, I worked around it by using github's version archive feature:

https://github.com///archive/e990804d7c301765409770582c6aa6d562a23198.tar.gz

Use this in your package.json in place of the version. For example:

"dependencies": {
   "colors":"https://github.com/fresheneesz/colors.js/archive/e990804d7c301765409770582c6aa6d562a23198.tar.gz",
}

@smikes
Copy link
Contributor

smikes commented Nov 17, 2014

Thanks for posting that workaround! I will add it to my proto-knowledge base. ;-)

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

No branches or pull requests

3 participants