1、清理npm缓存
npm cache clean -f
2、安装最新版本的Node helpe
npm install -g n
3、安装npm包管理助手
npm install -g n --force
4、安装npm
npm install
注意事项:使用mac的话npm前面加sudo,使用的国内的淘宝镜像的话前面加c。
npm安装失败(npm ERR! cb() never called! npm ERR! This is an error with npm itself)
原文:https://www.cnblogs.com/chill-yu/p/13966088.html