草稿 · 2022年4月30日 0

草稿:NPM基本操作 设置仓库

查看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