[BUG] npm treat every path from gitlab as git url even it is a dist path to .tgz
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.1k
- Forks
- 4.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 19
Description
Current Behavior:
Every path in gitlab generic package was treated as git repo url
For example https://gitlab.com/api/v4/projects/0000000/packages/generic/xxxxxxxx/0.0.1/dist.tar.gz
results in
npm ERR! code 128
npm ERR! command failed
npm ERR! command git ls-remote ssh://git@gitlab.com/api/v4/projects/0000000/packages/generic/xxxxxxxx/0.0.1/dist.tar.gz.git
npm ERR! remote:
npm ERR! remote: ========================================================================
npm ERR! remote:
npm ERR! remote: The namespace you were looking for could not be found.
npm ERR! remote:
npm ERR! remote: ========================================================================
npm ERR! remote:
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mmis1000/.npm/_logs/2020-12-23T05_24_20_136Z-debug.log
Expected Behavior:
It should be treated as a tarball url as the path suggests.
At least for path under the /api/ should just respect the path.
Instead of https://gitlab.com/api/v4/projects/0000000/packages/generic/xxxxxxxx/0.0.1/dist.tar.gz.git/
Steps To Reproduce:
npm initnpm i https://gitlab.com/api/v4/projects/0000000/packages/generic/xxxxxxxx/0.0.1/dist.tar.gz- See the error
Environment:
- OS: Mac 11.1
- Node: v10.21.0
- npm: 7.3.0
Note
The same bug exists in npm@6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with npm i https://gitlab.com/api/v4/projects/0000000/packages/generic/xxxxxxxx/0.0.1/dist.tar.gz, then trace npm's URL handling and git-versus-tarball resolution. Done means the .tar.gz URL is fetched as a tarball without appending .git or invoking git ls-remote.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, javascript, nodejs
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100