Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix npm install on cloud-native branch #16456

Merged
merged 1 commit into from
May 15, 2024

Conversation

jmgaya
Copy link

@jmgaya jmgaya commented May 15, 2024

TL;DR;

Just fix the npm install script

Explanation

The recommended Node Version for this repository is 10.15.1, which uses npm 6.4.1 under the hood (see .nvmrc).

When trying to install dependencies directly from Git repositories, this version of NPM uses internally the git: protocol, which performs operations such as:

  • /usr/bin/git ls-remote -h -t git://github.com/<organization>/<repository>.git
  • git clone --depth=1 -q -b master git://github.com/<organization>/<repository>.git <some-cache-directory>

However, Github dropped support for this protocol a while ago, hence npm install fails always.

The less elegant, but most pragmatic solution @Josmorsot and I found during the journey is to redirect every git: protocol request through https: by modifying the NPM configuration locally

@jmgaya jmgaya requested a review from a team May 15, 2024 11:29
@jmgaya jmgaya changed the base branch from master to cloud-native May 15, 2024 11:29
@jmgaya jmgaya merged commit 99c0c9b into cloud-native May 15, 2024
2 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant