Trying to create sites via the API using the npm package in nodejs but deploys keep failing?

I have a small server running in nodejs with an API endpoint I want to use to programmatically deploy sites to netlify. Using the npm package for netlify I have been able to create the site and it appears in my netlify account, its just the deploys keep failing immediately. Now if I manually go into netlify and trigger the deploy again, it deploys just fine with no settings changed by me.

The error I get:
“Failed during stage ‘preparing repo’: error checking for ref: fatal: could not read Username for ‘https://github.com’: No such device or address”

Here is my code:

const site = await netClient.createSite({
    account_slug: 'stinny', 
    body: {
      custom_domain: 'mystore.kretey.com',
      repo: {
        provider: 'github',
        repo_path: 'MY PATH',
        repo_url: 'MY REPO URL',
        private: true,
        branch: 'master',
        cmd: 'CI= npm run build',
        stop_builds: false,
        dir: 'build',
      },
    },
  });

Please help! I love netlify!!

Hey there, @Stinny :wave:

Apologies for the delay here! We took a look at your situation, and everything appears to be working now. Can you confirm if you are still encountering obstacles?

For folks who may be following along, this error (“Failed during stage ‘preparing repo’: error checking for ref: fatal: could not read Username for ‘https://github.com’: No such device or address”) usually means that someone has mis-linked the repo with an https://github.com/login/repo URI rather than what we need, which is a git@github.com/login/repo type URI.

This support guide has more details: