0

When I run npm install, I'm getting the following error:

Error

How can I solve this?

matiaslauriti
  • 7,065
  • 4
  • 31
  • 43
Diógenes
  • 1
  • 1
  • Does this answer your question? [NPM Install Error:Unexpected end of JSON input while parsing near '...nt-webpack-plugin":"0'](https://stackoverflow.com/questions/47675478/npm-install-errorunexpected-end-of-json-input-while-parsing-near-nt-webpack) – matiaslauriti Aug 02 '22 at 00:10
  • Please provide enough code so others can better understand or reproduce the problem. – Community Aug 02 '22 at 05:21

1 Answers1

0
  • Update your node.js to the latest

  • make sure that the node version is up to date by running:

    $ node -v

in your CMD and by visiting https://nodejs.org/en/download/current/ To know what is the latest version.

  • run this command in your CMD:

    $ npm cache clean --force

  • then Delete node_modules by running:

    $ rmdir /S /Q node_modules

or delete it manually by going into the directory and right-click > delete / move to trash. If you are not updating your packages you can delete the package-lock.json file too.

  • now you can run:

    $ npm install

This works for me, all the best.

  • I runned npm cache clean --force and runned NPM install as root, and it worked for me. Thank you very much – Diógenes Aug 03 '22 at 01:49