This commit is contained in:
anonymous 2021-04-11 19:18:47 +08:00
parent 585527a7e7
commit efb8142cc6

View File

@ -136,10 +136,14 @@ detect_config_version () {
## npm install 子程序判断是否为安卓判断是否安装有yarn ## npm install 子程序判断是否为安卓判断是否安装有yarn
npm_install_sub () { npm_install_sub () {
local cmd_1 cmd_2 if [ $is_termux -eq 1 ]; then
type yarn >/dev/null 2>&1 && cmd_1=yarn || cmd_1=npm npm install --production --no-save --no-bin-links --registry=https://registry.npm.taobao.org || npm install --production --no-bin-links --no-save
[[ $is_termux -eq 1 ]] && cmd_2="--no-bin-links" || cmd_2="" elif ! type yarn >/dev/null 2>&1; then
$cmd_1 install $cmd_2 --registry=https://registry.npm.taobao.org || $cmd_1 install $cmd_2 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
fi
} }
## npm install$1package.json文件所在路径 ## npm install$1package.json文件所在路径