npm 报错Unexpected end of JSON input while parsing near……

npm WARN notice Due to a recent security incident, all user tokens have been invalidated. Please see https://status.npmjs.org/incidents/dn7c1fgrr7ng for more details. To generate a new token, visit https://www.npmjs.com/settings/~/tokensor run “npm login”.

或者

Unexpected end of JSON input while parsing near ‘…ps://registry.npmjs.o’

解决方法:

npm set registry https://registry.npmjs.org/

文章最初发布在简书,时间为 2018.07.20 17:09 。

链接:https://www.jianshu.com/p/55b0a03c598f