muxinc/mux-stats-sdk-react-native-video

Use in CI environments

Closed this issue · 3 comments

installing like the README.md instructs gives out this error in CI

Any idea how to fix? CI is Github Actions

npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/muxinc/mux-stats-sdk-react-native-video.git
npm ERR! 
npm ERR! Warning: Permanently added the RSA host key for IP address '192.30.255.112' 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-07-26T16_04_01_175Z-debug.log```

@Kylar13 that appears to be an issue with with your ssh authentication against github. I think these debugging steps should help:

https://docs.github.com/en/github/authenticating-to-github/troubleshooting-ssh/error-permission-denied-publickey

To get back to you, apparently npm 7 has a bug where it will always save the "ssh" method in package-lock.json, even if you specify https on package.json. This is documented here

The workaround, for anyone running into this issue, is to specify your username in the https link, to make npm respect the installation method of using https when using npm ci.

To do this, just go into package.json and specify the url like this:

dependencies: {
  "mux-react-native-video-sdk": "git+https://<yourUsername>@github.com/muxinc/mux-stats-sdk-react-native-video#v0.1.0",
}

Hope this helps!! You can close this whenever @dylanjha

Whoa -- thanks for the details. We will need to get this published to npm anyway, but in the meantime I'm glad you're no longer blocked