编辑 ~/.npmrc 加入下面内容
~/.npmrc
prefix = D:\tool\nodejs\node_global cache = D:\tool\nodejs\node_cache registry = http://registry.cnpmjs.org #registry=https://registry.npmjs.org/ #proxy=http://127.0.0.1:1080 #https-proxy=http://127.0.0.1:1080