Cached wrong host means I can't run npm install

So I accidently pushed a package.json file containing the wrong host for git.

"dependencies": {
    "private-repo": "git+ssh://"

I’ve since corrected this replacing with just but circleci seems to have cached the old host and I can’t seem to bust it. The docs describing how to bust the cache are frankly terrible, it seems to describe a button I should be able to click without describing where this is located and I can’t see one anywhere. I’ve tried busting it from the api but that didn’t work.

git cloning the repo works when I ssh into the rerun job which suggests this is a npm/caching issue.

I’m unable to run a build for this job now because npm install keeps failing to resolve the host

ssh: Could not resolve hostname Name or service not known

So here’s the ridiculous length I had to go to to get around this.

Create a config file containing the ssh configs including the wrong hostname that resolves to just

     User git
     IdentityFile ~/.ssh/id_rsa

     User git
     IdentityFile ~/.ssh/id_rsa_somefingerprint

Base64 encode it to preserve whitespace/newlines and add this as a project environment variable in the CircleCI project settings. I’m also adding an ssh key via the “SSH Permissions” tab and injecting it below.

Then decode and write the result to a file in ~/.ssh/config

- add_ssh_keys:
    - "so:me:fi:ng:er:pr:in:t"

- run:
    name: "Setup ssh"
    command: |
      echo $SSH_CONFIG | base64 --decode > ${HOME}/.ssh/config

- run: npm install

Now it works. But this is a hack not a solution.