解决npm ERR! Unexpected end of JSON input while parsing near的方法汇总

这两天执行 npm install 时会报错误:vue

npm ERR! Unexpected end of JSON input while parsing near

这个错误的解决方法有如下几种:webpack

1.删掉package.lock.jsongit

2.清除cachegithub

npm cache clean --force

3.进入下面这个文件夹清除cache
路径:C:/Users/PC/AppData/Roaming/npm-cache
执行:web

npm cache clean --force

4.不要用淘宝镜像。npm

npm set registry https://registry.npmjs.org/

其实我也没搞懂究竟是什么问题形成的,有大神给解释一下?json

参考资料:https://github.com/vuejs-temp...code

相关文章
相关标签/搜索