解決npm安装卡住

proxy

用shadownsocks来proxy npm 临时

--proxy http://127.0.0.1:1087

永久

npm config set proxy http://127.0.0.1:1087
npm config set https-proxy http://127.0.0.1:1087

国内源

临时用

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

set

http://stackoverflow.com/questions/20747817/error-unable-to-verify-leaf-signature-phonegap-installation

npm config set strict-ssl false
npm config set registry http://registry.npm.taobao.org/

通过config命令

npm config set registry http://registry.cnpmjs.org

npm info underscore (如果上面配置正确这个命令会有字符串response)

命令行指定

npm --registry http://registry.c npmjs.org info underscore

编辑~/.npmrc 加入下面内容

registry = http://registry.cnpmjs.org