[BUG] Cannot install git package without HEAD ref
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- git, javascript
- Domain
- cli
Research direction
Start by reproducing the npm install command from the issue against a repository whose HEAD reference is unavailable, then trace the git reference resolution path that produces the undefined sha error. Done means the specified branch, commit hash, or tag can be installed without requiring a HEAD reference.
Written by the indexing model from the issue text.
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
npm install fails to clone branch, commit hash or tag when the repo does not have a HEAD reference.
Error Message:
`npm ERR! Cannot read properties of undefined (reading 'sha')
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Local\npm-cache_logs\2023-01-26T12_33_01_788Z-debug-0.log`
Expected Behavior
It should still be able to clone the specified reference.
Steps To Reproduce
- Run
npm install ssh+git://git@private/private_repo#reference - Wait for the error to show up.
`npm ERR! Cannot read properties of undefined (reading 'sha')
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Local\npm-cache_logs\2023-01-26T12_33_01_788Z-debug-0.log`
Environment
- npm: 9.3.1
- Node: v16.14.2
- OS: Windows 11 Pro 21H2 22000.1455 Windows Feature Experience Pack 1000.22000.1455.0
- platform:
- Dominant language
- JavaScript
- Stars
- 76
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
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.
More from npm/git
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Needs Triage
Difficulty 3/5 1-2 days Newbie friendliness 64/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
babalae/bettergi-scripts-list#3674 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
vadimdemedes/ink#1029 ·
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·