查看NPM当前配置:
npm config list
使用config命令指定源仓库
npm config set registry https://registry.npm.taobao.org
通过下载指定源仓库:
npm --registry https://registry.npm.taobao.org install
编辑 ~/.npmrc
grep 'registry' ~/.npmrc &>/dev/null && \
echo "registry already exists" || \
cat << EOF >>~/.npmrc
registry = https://registry.npm.taobao.org
EOF
评论区