I'm attempting to run npm install git+https://bitbucket.org/User/Repository
on Linux Raspbian 8.0. However, I get this error:
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t https://bitbucket.org/User/Repository.git
npm ERR!
npm ERR! remote: Invalid username or password
npm ERR! fatal: Authentication failed for 'https://bitbucket.org/User/Repository.git/'
npm ERR!
npm ERR! exited with error code: 128
My Bitbucket username and app password should be available in both the global and directory git configs:
git config user.name "Username"
git config user.password "Password"
git config --global user.name "Username"
git config --global user.password "Password"
So, the correct username and password should be available for npm
to use, but it doesn't seem to use them.
Also, for the avoidance of doubt, I have verified that the username and password are correct by using them with git
directly.
Any help in resolving this issue would be much appreciated!
Edit Thanks to Matthieu Moy in the comments for pointing out that the config values I was using do not actually have any special meaning for Git.
According to documentation, username and password combinations can be stored in ~/.git-credentials
. I have done so, in the form https://Username:Password@bitbucket.org
. However, the same error as above persists. I have verified that the username and app password are otherwise correct. Git simply does not seem to be using them.