npmterminalnpx

force "npx browserslist@latest --update-db"


I'm using npx browserslist@latest --update-db as part of my npm build process but sometimes it hangs waiting for user input:

Need to install the following packages:
browserslist@4.21.2
Ok to proceed? (y)

I run it as a script in my package.json

How do I skip that part and make it "auto-yes" in terminal so that my build process is not interrupted?

Can't find any info on that. Is that possible at all? I can't find any "-force" option for that so far.


Solution

  • It should be nowadays npx --yes browserslist@latest --update-db