npm install 报错

今天准备在服务器上部署一下pm2,发现 npm install -g pm2   爆出了错误

error Unexpected end of JSON input while parsing near '....

上网查了好久,终于查到了解决方法:

第一步 

npm install --registry=https://registry.npm.taobao.org --loglevel=silly

第二步

npm cache clean --force

源地址:https://blog.csdn.net/qq_38372358/article/details/79551446

原文地址:https://www.cnblogs.com/everythingcw/p/10333075.html