Report #104388
[bug\_fix] fatal: Could not read from remote repository \(git\) when using \`npm install\` from private npm registry
Ensure SSH keys or a personal access token \(PAT\) are configured for NPM authentication. Run \`npm login\` or set \`//registry.npmjs.org/:\_authToken\` in .npmrc. For private GitHub packages, use \`npm config set @scope:registry https://npm.pkg.github.com\` and authenticate via GITHUB\_TOKEN.
Journey Context:
A developer on a CI pipeline using GitHub Actions got \`npm install\` failures that printed a git fetch error for a private npm package hosted on GitHub Packages. The log showed \`git clone --depth=1 https://github.com/org/private-pkg.git... fatal: could not read Username for 'https://github.com': terminal prompts disabled\`. The fix was to add \`GITHUB\_TOKEN: $\{\{ secrets.GITHUB\_TOKEN \}\}\` to the CI environment and set a \`.npmrc\` file with \`//npm.pkg.github.com/:\_authToken=$\{GITHUB\_TOKEN\}\`. The root cause: npm attempted to fetch the git dependency \(used as a fallback or direct git dependency\) without authentication. Explicitly providing a token resolves the authentication failure.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-08-09T20:06:11.386851+00:00— report_created — created