title: GItHub - Permission denied (publickey) . . . none of the fixes are working
body: <p>I entered <code>npm install express-validator/check --save --scripts-prepend-node-path</code> and started getting error messages . . . to the effect: Permission denied (publickey). Prior to this, I executed many <code>npm install</code> commands without any problem. I don't think anything changed between the successful <code>npm install</code> commands and the one that failed above. </p>
  
  <p>I tried following all the online advice.</p>
  
  <p>I did <code>eval $(ssh-agent -s)</code> and it gave me an Agent pid.    </p>
  
  <p>I did <code>ssh-add ~/.ssh/id_rsa</code> and it said "added" (and I associated my email with the id).    </p>
  
  <p>I added my ssh key online in GitHub. </p>
  
  <p>Nothing has worked so far. Any more ideas or anything else I can try?</p>
  
  <p>Below is a dump of npm-debug.log:</p>
  
  <pre><code>0 info it worked if it ends with ok
  1 verbose cli [ 'C:\\Program Files (x86)\\Nodist\\v-x64\\10.15.0\\node.exe',
  1 verbose cli   'C:\\Program Files (x86)\\Nodist\\npmv\\4.0.5\\bin\\npm-cli.js',
  1 verbose cli   'install',
  1 verbose cli   'express-validator/check',
  1 verbose cli   '--save',
  1 verbose cli   '--scripts-prepend-node-path' ]
  2 info using npm@4.0.5
  3 info using node@v10.15.0
  4 silly loadCurrentTree Starting
  5 silly install loadCurrentTree
  6 silly install readLocalPackageData
  7 silly fetchPackageMetaData express-validator/check
  8 silly fetchOtherPackageData express-validator/check
  9 silly cache add args [ 'express-validator/check', null ]
  10 verbose cache add spec express-validator/check
  11 silly cache add parsed spec Result {
  11 silly cache add   raw: 'express-validator/check',
  11 silly cache add   scope: null,
  11 silly cache add   escapedName: null,
  11 silly cache add   name: null,
  11 silly cache add   rawSpec: 'express-validator/check',
  11 silly cache add   spec: 'github:express-validator/check',
  11 silly cache add   type: 'hosted',
  11 silly cache add   hosted:
  11 silly cache add    { type: 'github',
  11 silly cache add      ssh: 'git@github.com:express-validator/check.git',
  11 silly cache add      sshUrl: 'git+ssh://git@github.com/express-validator/check.git',
  11 silly cache add      httpsUrl: 'git+https://github.com/express-validator/check.git',
  11 silly cache add      gitUrl: 'git://github.com/express-validator/check.git',
  11 silly cache add      shortcut: 'github:express-validator/check',
  11 silly cache add      directUrl:
  11 silly cache add       'https://raw.githubusercontent.com/express-validator/check/master/package.json' } }
  12 verbose addRemoteGit caching express-validator/check
  13 verbose addRemoteGit express-validator/check is a repository hosted by github
  14 silly tryGitProto attempting to clone git://github.com/express-validator/check.git
  15 silly tryClone cloning express-validator/check via git://github.com/express-validator/check.git
  16 verbose tryClone git-github-com-express-validator-check-git-12105099 not in flight; caching
  17 verbose correctMkdir C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes correctMkdir not in flight; initializing
  18 info git [ 'config', '--get', 'remote.origin.url' ]
  19 warn addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
  19 warn addRemoteGit
  19 warn addRemoteGit     at ChildProcess.exithandler (child_process.js:294:12)
  19 warn addRemoteGit     at ChildProcess.emit (events.js:182:13)
  19 warn addRemoteGit     at maybeClose (internal/child_process.js:962:16)
  19 warn addRemoteGit     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
  19 warn addRemoteGit  express-validator/check resetting remote C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-12105099 because of error: { Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
  19 warn addRemoteGit
  19 warn addRemoteGit     at ChildProcess.exithandler (child_process.js:294:12)
  19 warn addRemoteGit     at ChildProcess.emit (events.js:182:13)
  19 warn addRemoteGit     at maybeClose (internal/child_process.js:962:16)
  19 warn addRemoteGit     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
  19 warn addRemoteGit   killed: false,
  19 warn addRemoteGit   code: 1,
  19 warn addRemoteGit   signal: null,
  19 warn addRemoteGit   cmd: 'git -c core.longpaths=true config --get remote.origin.url' }
  20 info resetRemote resetting C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-12105099 for express-validator/check
  21 silly gentlyRm C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-12105099 is being purged
  22 verbose gentlyRm don't care about contents; nuking C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-12105099
  23 silly vacuum-fs purging C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-12105099
  24 silly vacuum-fs quitting because other entries in C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes
  25 info git [ 'clone',
  25 info git   '--template=C:\\Users\\JR\\AppData\\Roaming\\npm-cache\\_git-remotes\\_templates',
  25 info git   '--mirror',
  25 info git   'git://github.com/express-validator/check.git',
  25 info git   'C:\\Users\\JR\\AppData\\Roaming\\npm-cache\\_git-remotes\\git-github-com-express-validator-check-git-12105099' ]
  26 error git clone --template=C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/express-validator/check.git C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-12105099: Cloning into bare repository 'C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-12105099'...
  26 error git clone --template=C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/express-validator/check.git C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-12105099: fatal: remote error:
  26 error git clone --template=C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/express-validator/check.git C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-12105099:   Repository not found.
  27 silly tryHTTPS attempting to clone git+https://github.com/express-validator/check.git
  28 silly tryClone cloning express-validator/check via git+https://github.com/express-validator/check.git
  29 verbose tryClone git-https-github-com-express-validator-check-git-31579c6b not in flight; caching
  30 verbose correctMkdir C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes correctMkdir not in flight; initializing
  31 info git [ 'config', '--get', 'remote.origin.url' ]
  32 warn addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
  32 warn addRemoteGit
  32 warn addRemoteGit     at ChildProcess.exithandler (child_process.js:294:12)
  32 warn addRemoteGit     at ChildProcess.emit (events.js:182:13)
  32 warn addRemoteGit     at maybeClose (internal/child_process.js:962:16)
  32 warn addRemoteGit     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
  32 warn addRemoteGit  express-validator/check resetting remote C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-express-validator-check-git-31579c6b because of error: { Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
  32 warn addRemoteGit
  32 warn addRemoteGit     at ChildProcess.exithandler (child_process.js:294:12)
  32 warn addRemoteGit     at ChildProcess.emit (events.js:182:13)
  32 warn addRemoteGit     at maybeClose (internal/child_process.js:962:16)
  32 warn addRemoteGit     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
  32 warn addRemoteGit   killed: false,
  32 warn addRemoteGit   code: 1,
  32 warn addRemoteGit   signal: null,
  32 warn addRemoteGit   cmd: 'git -c core.longpaths=true config --get remote.origin.url' }
  33 info resetRemote resetting C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-express-validator-check-git-31579c6b for express-validator/check
  34 silly gentlyRm C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-express-validator-check-git-31579c6b is being purged
  35 verbose gentlyRm don't care about contents; nuking C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-express-validator-check-git-31579c6b
  36 silly vacuum-fs purging C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-express-validator-check-git-31579c6b
  37 silly vacuum-fs quitting because other entries in C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes
  38 info git [ 'clone',
  38 info git   '--template=C:\\Users\\JR\\AppData\\Roaming\\npm-cache\\_git-remotes\\_templates',
  38 info git   '--mirror',
  38 info git   'https://github.com/express-validator/check.git',
  38 info git   'C:\\Users\\JR\\AppData\\Roaming\\npm-cache\\_git-remotes\\git-https-github-com-express-validator-check-git-31579c6b' ]
  39 error git clone --template=C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror https://github.com/express-validator/check.git C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-express-validator-check-git-31579c6b: Cloning into bare repository 'C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-express-validator-check-git-31579c6b'...
  39 error git clone --template=C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror https://github.com/express-validator/check.git C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-express-validator-check-git-31579c6b: remote: Repository not found.
  39 error git clone --template=C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror https://github.com/express-validator/check.git C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-express-validator-check-git-31579c6b: fatal: repository 'https://github.com/express-validator/check.git/' not found
  40 silly trySSH attempting to clone git@github.com:express-validator/check.git
  41 silly tryClone cloning express-validator/check via git@github.com:express-validator/check.git
  42 verbose tryClone git-github-com-express-validator-check-git-1312318e not in flight; caching
  43 verbose correctMkdir C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes correctMkdir not in flight; initializing
  44 info git [ 'config', '--get', 'remote.origin.url' ]
  45 warn addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
  45 warn addRemoteGit
  45 warn addRemoteGit     at ChildProcess.exithandler (child_process.js:294:12)
  45 warn addRemoteGit     at ChildProcess.emit (events.js:182:13)
  45 warn addRemoteGit     at maybeClose (internal/child_process.js:962:16)
  45 warn addRemoteGit     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
  45 warn addRemoteGit  express-validator/check resetting remote C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-1312318e because of error: { Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
  45 warn addRemoteGit
  45 warn addRemoteGit     at ChildProcess.exithandler (child_process.js:294:12)
  45 warn addRemoteGit     at ChildProcess.emit (events.js:182:13)
  45 warn addRemoteGit     at maybeClose (internal/child_process.js:962:16)
  45 warn addRemoteGit     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
  45 warn addRemoteGit   killed: false,
  45 warn addRemoteGit   code: 1,
  45 warn addRemoteGit   signal: null,
  45 warn addRemoteGit   cmd: 'git -c core.longpaths=true config --get remote.origin.url' }
  46 info resetRemote resetting C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-1312318e for express-validator/check
  47 silly gentlyRm C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-1312318e is being purged
  48 verbose gentlyRm don't care about contents; nuking C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-1312318e
  49 silly vacuum-fs purging C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-1312318e
  50 silly vacuum-fs quitting because other entries in C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes
  51 info git [ 'clone',
  51 info git   '--template=C:\\Users\\JR\\AppData\\Roaming\\npm-cache\\_git-remotes\\_templates',
  51 info git   '--mirror',
  51 info git   'git@github.com:express-validator/check.git',
  51 info git   'C:\\Users\\JR\\AppData\\Roaming\\npm-cache\\_git-remotes\\git-github-com-express-validator-check-git-1312318e' ]
  52 error git clone --template=C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:express-validator/check.git C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-1312318e: Cloning into bare repository 'C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-1312318e'...
  52 error git clone --template=C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:express-validator/check.git C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-1312318e: ERROR: Repository not found.
  52 error git clone --template=C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:express-validator/check.git C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-1312318e: fatal: Could not read from remote repository.
  52 error git clone --template=C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:express-validator/check.git C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-1312318e:
  52 error git clone --template=C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:express-validator/check.git C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-1312318e: Please make sure you have the correct access rights
  52 error git clone --template=C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:express-validator/check.git C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-1312318e: and the repository exists.
  53 silly fetchPackageMetaData Error: Command failed: git -c core.longpaths=true clone --template=C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:express-validator/check.git C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-1312318e
  53 silly fetchPackageMetaData Cloning into bare repository 'C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-1312318e'...
  53 silly fetchPackageMetaData ERROR: Repository not found.
  53 silly fetchPackageMetaData fatal: Could not read from remote repository.
  53 silly fetchPackageMetaData
  53 silly fetchPackageMetaData Please make sure you have the correct access rights
  53 silly fetchPackageMetaData and the repository exists.
  53 silly fetchPackageMetaData
  53 silly fetchPackageMetaData     at ChildProcess.exithandler (child_process.js:294:12)
  53 silly fetchPackageMetaData     at ChildProcess.emit (events.js:182:13)
  53 silly fetchPackageMetaData     at maybeClose (internal/child_process.js:962:16)
  53 silly fetchPackageMetaData     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
  53 silly fetchPackageMetaData  error for express-validator/check { Error: Command failed: git -c core.longpaths=true clone --template=C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:express-validator/check.git C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-1312318e
  53 silly fetchPackageMetaData Cloning into bare repository 'C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-1312318e'...
  53 silly fetchPackageMetaData ERROR: Repository not found.
  53 silly fetchPackageMetaData fatal: Could not read from remote repository.
  53 silly fetchPackageMetaData
  53 silly fetchPackageMetaData Please make sure you have the correct access rights
  53 silly fetchPackageMetaData and the repository exists.
  53 silly fetchPackageMetaData
  53 silly fetchPackageMetaData     at ChildProcess.exithandler (child_process.js:294:12)
  53 silly fetchPackageMetaData     at ChildProcess.emit (events.js:182:13)
  53 silly fetchPackageMetaData     at maybeClose (internal/child_process.js:962:16)
  53 silly fetchPackageMetaData     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
  53 silly fetchPackageMetaData   killed: false,
  53 silly fetchPackageMetaData   code: 128,
  53 silly fetchPackageMetaData   signal: null,
  53 silly fetchPackageMetaData   cmd:
  53 silly fetchPackageMetaData    'git -c core.longpaths=true clone --template=C:\\Users\\JR\\AppData\\Roaming\\npm-cache\\_git-remotes\\_templates --mirror git@github.com:express-validator/check.git C:\\Users\\JR\\AppData\\Roaming\\npm-cache\\_git-remotes\\git-github-com-express-validator-check-git-1312318e' }
  54 silly rollbackFailedOptional Starting
  55 silly rollbackFailedOptional Finishing
  56 silly runTopLevelLifecycles Finishing
  57 silly install printInstalled
  58 verbose stack Error: Command failed: git -c core.longpaths=true clone --template=C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:express-validator/check.git C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-1312318e
  58 verbose stack Cloning into bare repository 'C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-1312318e'...
  58 verbose stack ERROR: Repository not found.
  58 verbose stack fatal: Could not read from remote repository.
  58 verbose stack
  58 verbose stack Please make sure you have the correct access rights
  58 verbose stack and the repository exists.
  58 verbose stack
  58 verbose stack     at ChildProcess.exithandler (child_process.js:294:12)
  58 verbose stack     at ChildProcess.emit (events.js:182:13)
  58 verbose stack     at maybeClose (internal/child_process.js:962:16)
  58 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
  59 verbose cwd C:\Users\JR\dev\express-locallibrary-tutorial
  60 error Windows_NT 10.0.17134
  61 error argv "C:\\Program Files (x86)\\Nodist\\v-x64\\10.15.0\\node.exe" "C:\\Program Files (x86)\\Nodist\\npmv\\4.0.5\\bin\\npm-cli.js" "install" "express-validator/check" "--save" "--scripts-prepend-node-path"
  62 error node v10.15.0
  63 error npm  v4.0.5
  64 error code 128
  65 error Command failed: git -c core.longpaths=true clone --template=C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:express-validator/check.git C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-1312318e
  65 error Cloning into bare repository 'C:\Users\JR\AppData\Roaming\npm-cache\_git-remotes\git-github-com-express-validator-check-git-1312318e'...
  65 error ERROR: Repository not found.
  65 error fatal: Could not read from remote repository.
  65 error
  65 error Please make sure you have the correct access rights
  65 error and the repository exists.
  66 error If you need help, you may report this error at:
  66 error     &lt;https://github.com/npm/npm/issues&gt;
  67 verbose exit [ 1, true ]
  
  
  </code></pre>
  
  <p>SOLUTION:</p>
  
  <p>Unbelievable! I just tried <code>npm install express-validator --save --scripts-prepend-node-path</code> and it worked with no errors! It seems that the problem was with <code>express-validator/check</code> (it didn't like <code>/check</code> . . . not sure how to escape that) . . . A lot of heartache, but at least it had a happy ending!</p>