使用 pnpm 代替 yarn

This commit is contained in:
whyour
2021-05-16 23:09:20 +08:00
parent aa61fa7a45
commit e7355842d9
3 changed files with 8 additions and 6 deletions
+4 -4
View File
@@ -195,15 +195,15 @@ fix_config() {
fi
}
## npm install 子程序,判断是否为安卓,判断是否安装有yarn
## npm install 子程序,判断是否为安卓,判断是否安装有pnpm
npm_install_sub() {
if [ $is_termux -eq 1 ]; then
npm install --production --no-save --no-bin-links --registry=https://registry.npm.taobao.org || npm install --production --no-bin-links --no-save
elif ! type yarn >/dev/null 2>&1; then
elif ! type pnpm >/dev/null 2>&1; then
npm install --production --no-save --registry=https://registry.npm.taobao.org || npm install --production --no-save
else
echo -e "检测到本机安装了 yarn,使用 yarn 替代 npm...\n"
yarn install --production --network-timeout 1000000000 --registry=https://registry.npm.taobao.org || yarn install --production --network-timeout 1000000000
echo -e "检测到本机安装了 pnpm,使用 pnpm 替代 ...\n"
pnpm install --prod --registry=https://registry.npm.taobao.org || pnpm install --prod
fi
}