npm install卡住

如何解决npm install 卡住的问题

  1. 先排查具体情况
1
npm install --verbose

我们发现执行到下面的位置就卡住了

1
npm timing idealTree:userRequests Completed in 0ms

  1. 解决问题
  • 清除缓存
1
npm cache verify
  • 设置镜像源
1
npm config set registry https://registry.npmmirror.com