npm_install_helpers.ts

Declarations
#

view source

install_with_cache_healing
#

npm_install_helpers.ts view source

(repo: LocalRepo, ops: GitopsOperations, log?: Logger | undefined): Promise<void>

Installs npm dependencies with cache healing on ETARGET errors.

Strategy: 1. First attempt: regular npm install 2. On ETARGET error (stale cache): npm cache clean --force then retry 3. On other errors: fail immediately

Why ETARGET errors occur: After publishing a package and waiting for NPM registry propagation, npm's local cache may still have stale "404" metadata. This healing strategy clears the cache to force fresh metadata fetch.

repo

the repository to install dependencies for

ops

gitops operations (for dependency injection)

log?

optional logger

type Logger | undefined
optional

returns

Promise<void>

throws

  • Error - if install fails (with details about cache healing attempts)

Imported by
#