Nodejs packages.json, git@github URLs, ssh password


I’m trying to build & snap a nodejs project that uses a packages.json file with yarn.

The packages.json file has URLs to They currently take the form git+

Since I use ssh for git access, I cannot use git+https:// URLS. I’ve changed them to, but this does not work, I think because there is no opportunity during the snapcraft build for me to enter the ssh password.

Is there a method to get around this?


This can be handled by generating an access token on github, then:

`echo https://<YOUR_GITHUB_USERNAME>:<GITHUB_ACCESS_TOKEN> > ~/.git-credentials`
`git config --global credential.helper store`

Is there a specific reason why HTTPs URLs cannot be used? Are these repositories private?

Snapcraft builds ordinarily have no problems accessing HTTPs GitHub URLs.

It turned out to be auto providing the needed creds to git (without user prompting) during the snapcraft build, which the git credential stuff solved.

1 Like

OK, cool. @degville, do you think it could be helpful to document something about accessing private github repos?

Thanks for the ping (and thanks for the details @kyleN). I’ll test it out and add the details to the docs.

1 Like