pnpm: Cannot resolve external git packages

pnpm version: all

Code to reproduce the issue:

Add a custom git url as package.

"my-custom-package": "git+ssh://git@mygit.site/package.git#v0.1.7",

Expected behavior:

Resolves package

Actual behavior:

Does not resolve package.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 4
  • Comments: 16 (7 by maintainers)

Most upvoted comments

Indeed, it’s coming from npm-package-arg. I’ve opened #22 on them. Incidentally, it seems to happen only for non-github.com hosted repos.

A quick hack would be to use saveSpec rather than fetchSpec in fromRepo.ts and strip the initial ‘git+’. Let’s hope that’s not necessary if they response quickly.

I can take a look – can you point me to the appropriate test file?

$ pnpm -v 0.65.4

Not fixed:

URL from our gitlab: git@site:project/repo.git package: "git+ssh://git@site:project/repo.git#master"

   err: 
      name: "Error"
      message: "Command failed: git ls-remote --refs ssh://git@site/:project/repo.git master\nGitLab: The project you were looking for could not be found.\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n"
      code: 128

it changes url to:

ssh://git@site/:project/repo.git

than

ssh://git@site/project/repo.git

so

there is unwanted : in parsed url