shell 判断是否已安装了某个软件

# 判断是否安装了node
if ! type node >/dev/null 2>&1; then
    echo 'node 未安装';
else
    echo 'node 已安装';
fi
# 判断是否安装了npm
if ! type npm >/dev/null 2>&1; then
    Echo_Red 'npm 未安装';
    exit 1;
fi
原文地址:https://www.cnblogs.com/jiqing9006/p/13085794.html