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

I am trying to update Cypress to the latest version using the following provided command:
npm install --save-dev cypress#3.2.0
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)

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.

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.

Related

ERROR TypeError: Cannot read property 'version' of undefined Vue.js

When I run npm start
I get
ERROR TypeError: Cannot read property 'version' of undefined
TypeError: Cannot read property 'version' of undefined
This happens after I have run
npm install
I tried to solve the issue by running npm -g install npm#version but instead it gave me this error
npm ERR! code ETARGET
npm ERR! notarget No matching version found for npm#version.
Did you just upgrade your dependencies directly from 3.0?
In v4 eslint is required as a dependency of the project itself.
So npm install --save-dev eslint#4 may fix the warning.
From my experience it may happen if there is import of package.json in one of your project's files, but with incorrect path.
Usually, some build related configurations use version property of the package.json.
It is hard to pinpoint the exact issue, since no specifics provided.
First, I'd search stack trace of the error to locate which file is requesting package.json. Global project search for .version should help to find the issue as well.
If you still unable to locate the issue, please, add full error stack trace.

i have a problem when i am trying to install the npm

I have a problem with npm. npm install and this is the error message I have got:
npm WARN enonent ENOENT: no such file or direcotry, open 'C:\Users\pc5\package.json
I would be glad if you help me
If there no package.json (as the error message states) then you probably just forgot to run npm init as #BvdL pointed already out.
See especially here: https://docs.npm.red/creating-a-package-json-file#creating-a-new-packagejson-file

Upgrading jhipster from v5.0.1 to the latest

I am running linux 18.04, installed java 8. I am struggling with upgrading the current version of jhipster (v5.0.1)to the latest. I have used, yo, yarn and npm but there is no success.
With npm I get an error below, with yo i get the [subsequent] error:
Using JHipster version installed globally Executing jhipster:upgradeOptions:
Welcome to the JHipster Upgrade Sub-Generator
This will upgrade your current application codebase to the latest JHipster version
events.js:174
throw er; // Unhandled 'error' event
^
Error: ERROR! Current directory does not contain a JHipster project.
at Environment.error (/usr/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/lib/environment.js:157:40)
at module.exports.error (/usr/lib/node_modules/generator-jhipster/generators/generator-base.js:1981:18)
at module.exports.assertJHipsterProject (/usr/lib/node_modules/generator-jhipster/generators/upgrade/index.js:144:26)
at Object.<anonymous> (/usr/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:399:25)
at /usr/lib/node_modules/generator-jhipster/node_modules/run-async/index.js:25:25
at new Promise (<anonymous>)
at /usr/lib/node_modules/generator-jhipster/node_modules/run-async/index.js:24:19
at self.env.runLoop.add.completed (/usr/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:400:11)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
Emitted 'error' event at:
at Immediate.setImmediate (/usr/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:406:18)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
[subsequent]
? Generators to update (Press <space> to select, <a> to toggle all, <i> to invert selection)generator-jhipster
Unhandled rejection Error: EACCES: permission denied, open '/home/lelo/.npm/_cacache/index-v5/ad/54/831265f841b3fd278d23c4c96b06a32656a62c88fddaa7739f419602a04d'
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! /home/lelo/.npm/_logs/2019-08-25T22_22_40_369Z-debug.log```
Despite any user type, I am not getting the expected output which is the upgraded version of jhipster. What could I be doing wrong?
Make sure you are in your application directory and have git installed.
Then execute jhipster upgrade.
You will probably have to solve some problems of the resulting merge arising during the update.
More info: https://www.jhipster.tech/upgrading-an-application/

npm ERR! Unexpected end of JSON input while parsing near '...":{"shasum":"ae6c2edf'

npm ERR! Unexpected end of JSON input while parsing near '...":{"shasum":"ae6c2edf'
getting this error while npm install.
Steps i had done
1. create a new project
2. done npm install
getting this error for all new projects.
Cleaning the corrupted local npm cache may fix this error.
npm cache clean --force
Just run your npm command again after executing the above command in your terminal.
There could be few other reasons for the invalid JSON, as described in the official documentation here.
The official npm website has well documented most of the common errors. But unfortunately they don’t appear on the top results when you google the error.
updating angular cli to latest worked for me.

#webpack-cli/init npm install failure [webpack-cli]

I tried installing webpack && webpack-cli and the installation was successful, but i when i tried installing #webpack-cli/init i got this error message:
npm ERR! Unexpected end of JSON input while parsing near '...f7d7c27ab73cfaae06c46'
I have searched if this error exits but could not find anything. Please what am i doing wrong?
Just clear npm cache
npm cache clean --force
that solved my problem
Works for me. Try resetting cache or something.