6

This is the issue that I am facing when running the command npm ci in my GitHub action file.

Run npm ci
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/------
npm ERR! 
npm ERR! Warning: Permanently added the RSA host key for IP address '140.82.113.4' to the list of known hosts.
npm ERR! git@github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR! 
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR! 
npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2021-10-19T11_32_39_340Z-debug.log
sakshya73
  • 5,570
  • 5
  • 22
  • 41

1 Answers1

10

After a lot of research, I was able to figure out that this happens when you are using a forked npm package through your Github account. In the pipeline, it is trying to access via ssh.

For this, you need to add an extra step in your eas-pipeline.yml file after the Checkout step.

 - name: Checkout
        uses: actions/checkout@v2
        with:
          persist-credentials: false

*******************************************************************************

      - name: Reconfigure git to use HTTP authentication
        run: >
          git config --global url."https://github.com/".insteadOf
          ssh://git@github.com/
    

*******************************************************************************

As I wasn't able to find any solution on StackOverflow and StackOverflow is our first go-to place when we face any issue. So, I decided to write this answer here.

Here's the original answer: https://github.com/actions/setup-node/issues/214

sakshya73
  • 5,570
  • 5
  • 22
  • 41