'Unhandled rejection error: invalid config key requested when attempting to update Cypress via NPM

I am trying to update Cypress to the latest version using the following provided command:

npm install --save-dev [email protected]

In previous versions this has worked fine with no errors. Now, when I run this, I keep getting the following error:

Unhandled rejection Error: invalid config key requested: agentn 099cbf610e4ce787
    at BadKeyError (/usr/local/lib/node_modules/npm/node_modules/figgy-pudding/index.js:93:23)
    at pudGet (/usr/local/lib/node_modules/npm/node_modules/figgy-pudding/index.js:101:5)
    at FiggyPudding.get (/usr/local/lib/node_modules/npm/node_modules/figgy-pudding/index.js:27:12)
    at Object.get (/usr/local/lib/node_modules/npm/node_modules/figgy-pudding/index.js:159:16)
    at new PacoteOptions (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/util/opt-check.js:9:21)
    at optCheck (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/util/opt-check.js:63:10)
    at Object.manifest (/usr/local/lib/node_modules/npm/node_modules/pacote/manifest.js:11:10)
    at fetchPackageMetadata (/usr/local/lib/node_modules/npm/lib/fetch-package-metadata.js:58:10)
    at limited (/usr/local/lib/node_modules/npm/node_modules/call-limit/call-limit.js:29:10)
    at /usr/local/lib/node_modules/npm/lib/install/deps.js:235:14
    at /usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:35
    at Array.forEach (<anonymous>)
    at /usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:11
    at Array.forEach (<anonymous>)
    at asyncMap (/usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:51:8)
    at exports.getAllMetadata (/usr/local/lib/node_modules/npm/lib/install/deps.js:206:3)

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jaswindersingh/.npm/_logs/2019-03-15T13_32_13_190Z-debug.log

Could anyone point me to what this means and how I can fix it? Never seen this kind of error before?

And as far as I know I've not made any changes to any of my packages in either package.json or package-lock.json etc (from what I have read so far from similar posts)



Solution 1:[1]

I think this is an npm issue.

Try to delete package-lock.json and run your command again. This should solve your problem.

Also, if you can, try to upgrade your npm version, since this issue is marked as closed in npm repository.

Solution 2:[2]

It is really npm issue. Try to change version to some up-to-date one. If there is some problems with it, you can use nvm.

In my case I`ve changed node version 10.8.0 to 12.18.3 and npm as well.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Diogo Rocha
Solution 2 ouflak