0

I am using AWS Amplify, when I push code of react to my branch, CI/CD runs and on "npm install" build fails on AWS Amplify, with error

npm 2022-01-11T09:31:06.876Z [WARNING]: ERR! Error while executing: npm ERR! /usr/bin/git ls-remote -h -t git://github.com/danteata/passport-oauth.git npm ERR! npm ERR! fatal: remote error: npm ERR! The unauthenticated git protocol on port 9418 is no longer supported. npm ERR! Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information. npm ERR! npm ERR! exited with error code: 128

I've also tried to replce git://git.. with https://git.... in package-lock.json (suggested by https://github.blog/2021-09-01-improving-git-protocol-security-github/) but the build fails with the same error.

1 Answer 1

0

We got over this by adding git config --global url."https://".insteadOf git:// to the Build Specification amplify.yml preBuild commmands (just before npm install).

See below:

amplify.yml

...
frontend:
  phases:
    preBuild:
      commands:
        - git config --global url."https://".insteadOf git://
        - npm install
...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.