Unexpected end of JSON input while parsing near ‘…”,”shelljs” 安装vue cli

标签:

本文出自jvm123.com-java技术分享站:http://jvm123.com/2019/08/unexpected-npm.html

在使用npm安装 vue cli 的时候,出现以下错误

2339 verbose Windows_NT 10.0.18362
2340 verbose argv "D:\Program Files\node-v10.3.0-win-x64\node.exe" "D:\Program Files\node-v10.3.0-win-x64\node_modules\npm\bin\npm-cli.js" "install" "-g" "@vue/cli"
2341 verbose node v10.3.0
2342 verbose npm  v6.1.0
2343 error Unexpected end of JSON input while parsing near '...","shelljs":"^0.7.6"}'
2344 verbose exit [ 1, true ]
Unexpected end of JSON input while parsing near ‘…”,”shelljs” 安装vue cli插图

很可能是上次安装失败的缓存原因,可使用以下代码清除npm缓存,再次尝试安装。

npm cache clean --force

发表评论