pnpm: Cannot download from private git+ssh repositories: ERR_INVALID_URL

Hello! first of all, I want to say that it’s exactly the tool I ever wanted since npm is born 😄 So, thank you!!

However, I’m facing an issue with private repository hosted on a gitlab internal installation. The error I’m retrieving is the following (i’ve obfuscated the url):

 ERROR  Invalid URL: git+ssh://git@gitlab.****.**:yield-insight/cli
at TypeError [ERR_INVALID_U…
at onParseError               internal/url.js:243
at new URL                    internal/url.js:319
at parsePref [as default]     ../../../../../Users/gronca/AppData/Roaming/npm/node_modules/pnpm/lib/node_modules/@pnpm/git-resolver/lib/parsePref.js:29  const urlparse = new url…
at resolveGit                 ../../../../../Users/gronca/AppData/Roaming/npm/node_modules/pnpm/lib/node_modules/@pnpm/git-resolver/lib/index.js:8       const parsedSpec = await…
at resolve                    ../../../../../Users/gronca/AppData/Roaming/npm/node_modules/pnpm/lib/node_modules/@pnpm/default-resolver/lib/index.js:13  || await resolveFromGit(…
at async run                  ../../../../../Users/gronca/AppData/Roaming/npm/node_modules/pnpm/lib/node_modules/p-queue/dist/index.js:255               resolve(await operation);

Looks like pnpm is not able to read URL with git+ssh:// protocol. How can I solve it keeping the compatibility with npm?

pnpm version:

4.9.3

Additional information:

  • Windows & Linux

About this issue

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

Commits related to this issue

Most upvoted comments

Because of this, i have to switch back to npm

Has this been acknowledged as a bug? Seems like something which should have been prioritised for a quick patch.

Ok I’ve solved simply replacing the column character after the domain.

git+ssh://git@gitlab.89109.nl:yield-insight/cli.git -> git+ssh://git@gitlab.89109.nl/yield-insight/cli.git

The previous syntax is supported by npm but is not parsed by the nodejs URL parser

However, you could consider to fix it improving support for package.json since the url with column is the official syntax supported by npm

pnpm looks great, thanks for this tool ❤️ Would love to see that issue resolved, tho. It takes unnecessary long time to show this warnings. Also, setting fetch-retries in .npmrc etc. doesn’t seem to have any effect on this.