While installing the eslint
npm package like this
npm i eslint -g
I got the below error:
npm ERR! Unexpected end of JSON input while parsing near '..."coveralls":"2.11.4",'
How can I fix this?
Run: “npm cache clean –force” are both not working and you still can't clear the cache, you can force clear the cache by running: npm cache clean --force or npm cache clean -f . This will force delete the npm cache on your computer.
Method 1: Using npm update command to update the node package manager. Method 2: Using npm@latest command to update the node package manager. Method 3: Using PPA repository (only for Linux). Method 4: Using cache cleaning & stable installing (only for Linux).
Unexpected end of JSON input while parsing near '...nd-index-1.0.2.tgz" vuejs-templates/webpack#990 Yes,Clear the npm cache, If PLAN A doesn't work , Delete the complete npm cache and npm files from the folder and re-install it completely.
When you try to install a new package from the npm, sometimes you will see this following error due to the cache folder of npm gets corrupted. npm ERR! Unexpected end of JSON input while parsing near '...ic":"^3.0.0"} ,"devDep' npm ERR!
Show activity on this post. This happens something due to cache or outdated version of Node Package Manager i just updated my NPM it works fine here is command to update Npm to latest version Show activity on this post. Try to execute the installing cmd in admin folder.
It is now read-only. npm is crashing. npm is producing an incorrect install. npm is doing something I don't understand. What's going wrong?
Follow these below steps:
Method 1:
1. clean your cache
npm cache clean --force
2. Then install latest angular cli:
npm install -g @angular/cli@latest
3. Then install your package
npm install -g eslint
Method 2:
1. Uninstall nodejs
2. Clear cache by this command: npm cache clean --force
3. delete package-lock.json
and node node_modules
folder
4. Install nodejs latest version
5. Install latest angular cli npm install -g @angular/cli@latest
.
6. Run npm install
.
7. Install your desired package that you wants.
Hope it resolve your issue.If not then please let me know.Generally,In most of the cases method 1 works if method 1 not works go for 2nd method. Thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With