-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
yarn add <git remote url> returns "Permission denied" error #686
Comments
The split and removal of the |
Issue confirmed for me as well, I'm unable to add a git remote directly as specified above. |
This doesn't work with npm either: |
Absolutely, assuming you add the protocol as required. In fact, this line from my You can try for yourself with |
Ah, I've got a PR to fix that one here: #934 That specifically is an issue with the auth segment of the URL ( |
Ohh, it doesn't work with the SSH syntax either, though. |
need to add tests, make sure it didnβt break other things. general idea is: for a URL like βssh://git@github.com:radweb/eslint-config-radweb.gitβ, the β:β needs replacing for the Git to fetch it. secondly, after add, the βversionβ in the package.json was getting butchered to βgithub:radweb/eslint-config-radwebβ. giving exotic resolvers higher priority fixes this. i think similar code exists elsewhere, need to check.
I've got a fix prepared for SSH URLs. Need to add tests and check a few other places too, but it's late here so I'll continue tomorrow danharper@2eaf66d (explanation is in the commit message) |
@danharper cool, since you are moving exotic resolvers higher priority, see if you can remove this code, as moving the priority might resolve #59 and make this code unnecessary? |
@troydemonbreun I've got a PR open for that here: #934. Basically replaces that block with a protocol check instead. |
@danharper I checked npm (v3.8.6) installation. It returns:
For me it's better information than misleading error with lack of access. Thanks for working on this π |
Thanks for working on this π |
Hi, |
I have just tried on latest nightly (0.18.0-20161114.1729) and the issue remains. Is there a workaround? Is this bug difficult to resolve? It seems to simple to avoid mangling the git URL we inform in the command line... |
This works: This doesn't work: With or without the
EDITHere's the workaround: Notice the |
The original issue doesn't seems like a bug, in that Yarn is (somewhat rightfully) trying to install the I'm going to close this issue for triage, but discussion is still open. |
Why close the issue rather than fix it? Community wants it working and is contributing for its solution. |
As far as I understood, the fix relies on simply letting the URL informed in the command line as it is, instead of changing it to some kind of guess. |
@jbruni There's an ambiguity in the command line grammar. If you write |
Maybe we can improve the ambiguity resolution strategy - since in this case it is failing. Maybe we can keep it as it is, but if there is a fail to install that package, then it could "make another guess", ie, assume the other possibility of interpretation is correct, and try it. |
Tried all variations mentioned here, none works. So how to add package by branch or commit? :/ |
only http works for me now: |
I also got this error, and checked the git config and repo auth setup, but got nothing. Then removed nvm, node(installed from brew), yarn(installed from brew), then just install node from official web, and yarn from npm. Did not install nvm. Then, it's allright!!! |
In my case it was asking for my password, then for some reason it always failing with this same error, after the command |
seeing this in yarn |
@daviskoh can you try with the latest nightlies? Also what is your git version? Are you using a proxy for git etc.? |
For me it worked with 0.25.2 with my ssh keys (for bitbucket) in pageant, but it does not work with 0.27.0 |
@BYK it worked after adding the following to my ~/.ssh/config:
and forcing a pull / push on the private repo 1st I'm guessing to "show" I have permissions on it. Cant remember which user and which git issue suggested to do this as there are a lot of similar issues. My git version: 2.11.0 |
@natecox thanks your anwser! git url must add prefix |
The funny part is that I'm trying to do the same with Yarn & Phabricator (both FB technology) and it also doesn't seem to work (only over https). Connection simply timesout. |
hey I am facing the same issue but I also have a passphrase on my ssh which is why i am getting Permission denied |
Was hitting this issue as well and prefixing with Note: this is a public repo so I didn't have any permission issues |
I am hitting the same "dependencies": {
"git+ssh://git@github.com/MyUser/MyRepo.git#abcdef1234..."
} This is with ssh-agent running. I can access the private repo fine from git on the command line. |
It looks like my problem came from using the new OpenSSH for Windows 10. I uninstalled this via "Manage Optional Features" (which required a reboot), and then installed posh-git. After running Although I use git on WSL everywhere else, this requires git for windows. |
THIS DOES NOT WORK IF YOU WANT TO SETUP WITH PASSPHRASE.
|
Does this work if you have a passphrase set? |
@mikebridge, no it does not work with passphrase. :( |
|
getting the same error on node version : 8.0.0 when running my package dependencies look like this
Build fails when
|
in my case it was due to the key having a passphrase |
Do you want to request a feature or report a bug?
bug
What is the current behavior?
yarn add
returns "Permission denied" errorIf the current behavior is a bug, please provide the steps to reproduce.
yarn add git@github.com:<user>/<repository>.git
What is the expected behavior?
As you can notice in:
Arguments: clone github.com:szemek/cheatsheets.git /Users/szemek/.yarn-cache/.tmp/087b27ef145b8d7861743348d6045535
git@
shouldn't be stripped from git remote url.Note: it doesn't matter that mentioned repository doesn't contain
package.json
. For my private repository with https protocol it worked just fine.Please mention your node.js, yarn and operating system version.
node.js v6.0.0
yarn 0.15.1
OS X 10.11.6
The text was updated successfully, but these errors were encountered: