0
votes

$ npm install [email protected] --save npm ERR! Unexpected end of JSON input while parsing near '...TzfxLvz8PuwMlgQXO+TPr'

npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\PACHU\AppData\Roaming\npm-cache_logs\2018-06-14T05_43_34_319Z-debug.log

5
this can happen if you try to install older packages on higher version of node - Manoz

5 Answers

4
votes

Try cleaning npm cache:

npm cache clean --force

After that you can try to install it again.

3
votes

Seems you have some broken dependencies or caching problem. So first, delete your node_module, then delete your package-lock.json and yarn.lock.

`rm -rf node_modules` 
`rm -ef package-lock.json`
`rm -rf yarn.lock` 

You can clear npm cache using the following command

npm cache clean --force
npm cache verify

You can also clean yarn cache using

yarn cache clean

Then close your current terminal and open a new one. Finally, install your dependencies again using

npm install react-router-dom --save or yarn add react-router-dom --save

1
votes

Install yarn and try:

yarn add react-router-dom --save
0
votes

Delete your npm module file run this command npm cache clean --force run this command npm i react-router react-router-dom --save everything should be ok .

0
votes

Delete your npm module file run this command npm cache clean --force run this command npm i react-router react-router-dom --save everything should be ok .

  1. npm cache clean --force run
  2. npm i react-router react-router-dom --save