Is there an existing issue for this?
Current Behavior
hosted-git-info generates the old GitLab archive URL format:
This causes TAR_BAD_ARCHIVE: Unrecognized archive format errors when installing any git+https://gitlab.com/ dependency via npm, because npm receives an HTML sign-in page instead of a tarball.
Expected Behavior
The tarball is downloaded, not redirected to the signin html / does not download the signin html
No response
Steps To Reproduce
- Have a private GitLab repo as a dependency: "my-pkg": "git+https://gitlab.com/my-group/my-repo.git#branch"
- Run npm install
- Get TAR_BAD_ARCHIVE: Unrecognized archive format
Old format (what hosted-git-info generates) - broken:
curl -s -o /dev/null -w "%{http_code}" -H "PRIVATE-TOKEN: $TOKEN" "https://gitlab.com/group/repo/repository/archive.tar.gz?ref=main"
Returns: 302 (redirects to /users/sign_in)
New format - works
curl -s -o /dev/null -w "%{http_code}" -H "PRIVATE-TOKEN: $TOKEN" "https://gitlab.com/group/repo/-/archive/main/repo-main.tar.gz"
Returns: 200
Environment
- npm: (as per node versions below)
- Node: tried 18, 20, 22, 24
- OS: tried MacOS, Ubuntu 20, 22
- platform: tried Local machine (Mac), Gitlab Runner CICD (self hosted on Ubuntu 20)
Is there an existing issue for this?
Current Behavior
hosted-git-info generates the old GitLab archive URL format:
This causes TAR_BAD_ARCHIVE: Unrecognized archive format errors when installing any git+https://gitlab.com/ dependency via npm, because npm receives an HTML sign-in page instead of a tarball.
Expected Behavior
The tarball is downloaded, not redirected to the signin html / does not download the signin html
No response
Steps To Reproduce
Old format (what hosted-git-info generates) - broken:
curl -s -o /dev/null -w "%{http_code}" -H "PRIVATE-TOKEN: $TOKEN" "https://gitlab.com/group/repo/repository/archive.tar.gz?ref=main"
Returns: 302 (redirects to /users/sign_in)
New format - works
curl -s -o /dev/null -w "%{http_code}" -H "PRIVATE-TOKEN: $TOKEN" "https://gitlab.com/group/repo/-/archive/main/repo-main.tar.gz"
Returns: 200
Environment