解决【npm ERR! Unexpected end of JSON input while parsing near '...sh_time":141072930277'】方案

问题描述
执行npm install的时候报错npm ERR! Unexpected end of JSON input while parsing near '...sh_time":141072930277'.如下图:

解决方案
直接执行 npm cache clean --force, 如果执行成功,再npm install即可。
如果执行失败,请先升级npm,即npm i -g npm, 最后再执行npm cache clean --force, 最后再npm install.
如果还执行失败,那就先npm cache verify,再npm cache clean --force,最后再npm install。
如果还是执行失败,那么恭喜你,跟我一样了。我也是这样走到这一步的。那就往复的执行 【先npm cache clean --force再npm install】,一直到npm cache clean --force执行成功即可,然后npm install即成功。我前后往复执行了三次才成功!骚年,加油!
如果 npm cache clean --force 执行成功会提示:npm WARN using --force I sure hope you know what you are doing. 如下图:


最后
别忘了,往复的执行 【先npm cache clean --force再npm install】。多试几遍就可以了。

.

猜你喜欢

转载自www.cnblogs.com/jianxian/p/10624829.html