安装 vue CLI 时出错:npm ERR!在“...ulp-rename”:“0.0.33”,'附近解析时 JSON 输入意外结束

Error while installing vue CLI: npm ERR! Unexpected end of JSON input while parsing near '...ulp-rename":"0.0.33",'

我有一个旧版本的 vue CLI,我想升级到 CLI 3,所以我首先要做的是卸载以前的版本:

npm uninstall vue-cli -g

然后尝试安装:

npm install -g @vue/cli

我收到以下错误:

npm ERR! Unexpected end of JSON input while parsing near '...ulp-rename":"0.0.33",'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users089\AppData\Roaming\npm-cache\_logs20-02-02T11_48_31_187Z-debug.log

完整的日志信息可见here
我的 node 版本:v12.14.0
我的 npm 版本:6.13.4
我试过了

npm cache clean --force  

但没有用。

我发现,如果您 运行 命令提示符 window 作为管理员,那么首先执行

npm cache clean --force  

然后可以安装成功