Skip to content
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

Installing from GitHub pull request not working #2045

Closed
hacknug opened this issue Oct 2, 2019 · 5 comments · Fixed by #4953
Closed

Installing from GitHub pull request not working #2045

hacknug opened this issue Oct 2, 2019 · 5 comments · Fixed by #4953

Comments

@hacknug
Copy link

hacknug commented Oct 2, 2019

I have the feeling there's something I'm missing but I wasn't able to find any issues mentioning this specific use-case so here we go…

pnpm version:

pnpm v3.8.1

Code to reproduce the issue:

Try to add a dependency given a PR in a public GitHub repo:

pnpm add --save-dev bradlc/tailwindcss-alpha#pull/7/head # npm syntax
pnpm add --save-dev bradlc/tailwindcss-alpha#7/head # yarn syntax

Expected behavior:

pnpm should be able to install a dependency from a given PR, matching the way both npm and yarn work. It would also be great if pnpm could accept both npm and yarn's syntax for this (they're different).

Actual behavior:

 ERROR  Could not resolve pull/7/head to a commit of git://github.com/bradlc/tailwindcss-alpha.git.
at resolveRefFromRefs         ../../../../../usr/local/pnpm-global/2/node_modules/.registry.npmjs.org/pnpm/3.8.1/node_modules/pnpm/lib/node_modules/@pnpm/git-resolver/lib/index.js:75      throw new Error(`Could n…
at resolveRef                 ../../../../../usr/local/pnpm-global/2/node_modules/.registry.npmjs.org/pnpm/3.8.1/node_modules/pnpm/lib/node_modules/@pnpm/git-resolver/lib/index.js:66      return resolveRefFromRef…
at processTicksAndRejections  internal/process/task_queues.js:93                                                                                                                                                     
at async resolveGit           ../../../../../usr/local/pnpm-global/2/node_modules/.registry.npmjs.org/pnpm/3.8.1/node_modules/pnpm/lib/node_modules/@pnpm/git-resolver/lib/index.js:11      const commit = await res…
at resolve                    ../../../../../usr/local/pnpm-global/2/node_modules/.registry.npmjs.org/pnpm/3.8.1/node_modules/pnpm/lib/node_modules/@pnpm/default-resolver/lib/index.js:13  || await resolveFromGit(…
at async run                  ../../../../../usr/local/pnpm-global/2/node_modules/.registry.npmjs.org/pnpm/3.8.1/node_modules/pnpm/lib/node_modules/p-queue/dist/index.js:246
Resolving: total 81, reused 64, downloaded 0
 ERROR  Could not resolve 7/head to a commit of git://github.com/bradlc/tailwindcss-alpha.git.
at resolveRefFromRefs         ../../../../../usr/local/pnpm-global/2/node_modules/.registry.npmjs.org/pnpm/3.8.1/node_modules/pnpm/lib/node_modules/@pnpm/git-resolver/lib/index.js:75      throw new Error(`Could n…
at resolveRef                 ../../../../../usr/local/pnpm-global/2/node_modules/.registry.npmjs.org/pnpm/3.8.1/node_modules/pnpm/lib/node_modules/@pnpm/git-resolver/lib/index.js:66      return resolveRefFromRef…
at processTicksAndRejections  internal/process/task_queues.js:93                                                                                                                                                     
at async resolveGit           ../../../../../usr/local/pnpm-global/2/node_modules/.registry.npmjs.org/pnpm/3.8.1/node_modules/pnpm/lib/node_modules/@pnpm/git-resolver/lib/index.js:11      const commit = await res…
at resolve                    ../../../../../usr/local/pnpm-global/2/node_modules/.registry.npmjs.org/pnpm/3.8.1/node_modules/pnpm/lib/node_modules/@pnpm/default-resolver/lib/index.js:13  || await resolveFromGit(…
at async run                  ../../../../../usr/local/pnpm-global/2/node_modules/.registry.npmjs.org/pnpm/3.8.1/node_modules/pnpm/lib/node_modules/p-queue/dist/index.js:246
Resolving: total 102, reused 75, downloaded 0

Additional information:

  • node -v prints: v12.11.0
  • Windows, OS X, or Linux?: macOS
@btecu
Copy link

btecu commented Jul 24, 2020

I'm also running into this issue.

@wclr
Copy link

wclr commented Sep 23, 2020

Too bad. Though install from commit hash is working.

@armenr
Copy link

armenr commented Aug 9, 2021

Same issue here. Does anyone have a fix?

@apteryxxyz
Copy link

Has this ever been fixed?

@heyarne
Copy link

heyarne commented Jan 31, 2022

I still ran into this issue today, installed the dependency via owner/repo#commit-hash instead.

@zkochan zkochan added this to Priority in Status Jan 31, 2022
zkochan pushed a commit that referenced this issue Jun 29, 2022
Previously, if you wanted to check out a git PR branch,
you needed to specify the url as:
`github:pnpm/pnpm#refs/pull/123/merge`.
Now this will resolve without the leading "refs":
`github:pnpm/pnpm#pull/123/merge`

close #2045
zkochan pushed a commit that referenced this issue Jun 30, 2022
Previously, if you wanted to check out a git PR branch,
you needed to specify the url as:
`github:pnpm/pnpm#refs/pull/123/merge`.
Now this will resolve without the leading "refs":
`github:pnpm/pnpm#pull/123/merge`

close #2045
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Status
Priority
Development

Successfully merging a pull request may close this issue.

7 participants