You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何让npx browserslist@latest --update-db自动确认避免构建中断?

解决npx browserslist命令停滞等待输入的问题

直接在命令里加上--yes(缩写-y也能用)参数,就能自动确认安装,避免构建流程卡壳:

npx browserslist@latest --update-db --yes

要是在CI/CD这类环境里,也可以用环境变量全局跳过确认:

npm_config_yes=true npx browserslist@latest --update-db

把脚本写到package.json里的话,直接带参数就行:

{
  "scripts": {
    "update-browserslist": "npx browserslist@latest --update-db --yes"
  }
}

这个--yes是npm/npx的通用参数,不是browserslist自己的选项,所以你之前在browserslist的文档里找不到很正常,它能自动同意所有交互式的确认请求,不用手动敲y。

内容的提问来源于stack exchange,提问作者vir us

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.26 01:45:36