Unexpected end of JSON input while parsing near '…"

npm insatll 命令报错:

Unexpected end of JSON input while parsing near '…"

此问题似乎出在使用的npm镜像(淘宝)上-它返回的文件不完整;

解决方法:

  清理缓存:npm cache clean --force

  更新镜像:npm install --registry=https://registry.npm.taobao.org --loglevel=silly

  也可以不使用淘宝镜像:npm set registry https://registry.npmjs.org/

posted @ 2020-02-19 11:02  yantx  阅读(325)  评论(0编辑  收藏  举报