Closed Coding-Kiwi closed 1 month ago
Generally you should have git installed if you are using the git dependencies https://docs.npmjs.com/cli/v10/commands/npm-doctor#checking-for-git-executable-in-path
When running npm install
, it does say that git
can not be spawn
/app # npm install https://github.com/npm/promise-spawn.git
npm error code ENOENT
npm error syscall spawn git
npm error path git
npm error errno -2
npm error enoent An unknown git error occurred
npm error enoent This is related to npm not being able to find a file.
npm error enoent
npm error A complete log of this run can be found in: /root/.npm/_logs/2024-08-26T15_55_15_629Z-debug-0.log
Not able to reproduce the issue and come to the exact error mentioned in the report. Closing as I believe it's not an issue as npm cli as npm requires git to be installed.
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
running npm install or npm ci when git is not available causes the error
which is a bit misleading in my opinion, I searched way to long for what the issue is because npm did not hint anything in that direction, not even when running with --verbose
Expected Behavior
Throw a clear error telling the user "cannot install git dependency, there is no git executable available"
Steps To Reproduce
npm i -D git+https://myrepo.com/user/repo.git#hash
)npm ci
in pipelineapk add --no-cache git
to the pipeline script and it worksEnvironment
prefix = "C:\Users\MyUser\AppData\Roaming\npm"
; node bin location = C:\Program Files\nodejs\node.exe ; node version = v20.16.0 ; npm local prefix = C:\
; npm version = 10.8.2
; cwd = C:\
; HOME = C:\Users\MyUser
; Run
npm config ls -l
to show all defaults.