Unexpected end of JSON input while parsing near '....1","eslint-loader":"'

924 阅读1分钟

前端项目使用 npm install vuetify --save 命令时出现如下错误

✗ npm install vuetify --save
npm ERR! Unexpected end of JSON input while parsing near '....1","eslint-loader":"'

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/YW/.npm/_logs/2020-02-18T08_25_12_040Z-debug.log

解决方案

使用 npm cache clean --force 清理 npm 缓存

设置官方源地址 npm set registry https://registry.npmjs.org/

✗ npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.
✗ npm set registry https://registry.npmjs.org/
✗ npm install vuetify --save                  
+ vuetify@2.2.12
...