今天拿vue-cli构建vue项目,在npm install依赖包的时候出现了Unexpected end of JSON input while parsing near '...hment":false,"tarball'的错误,因而上网搜查了一下,有说是因为淘宝镜像的缘由,因而我就把仓库地址设为https://cnpmjs..org,再进行npm的时候,因为网速太慢,install了半天没反应。html
只有另寻他法,在该网址:http://xxd3vin.github.io/2017/09/26/npm-unexpected-end-of-json-input-while-parsing-near.html发现也出现了一样的错误,只用了一个命令,npm cache clean --force 。因而将仓库地址从新换成淘宝镜像,使用该命令:npm config set registry https://registry.npm.taobao.org;而后在清除缓存npm cache clean --force。最后竟然成功了vue