npm命令中的-s是什么意思?

What does -s mean in npm command?

我看到以下命令包含 -s 选项。它(-s)是什么意思?因为没看到package.json.

里面的选项
$ npm run dev -s

标志 -s 代表 "silent" 并应用于 npm,而不是 dev 脚本中的命令。

当命令以非零状态退出时,即当命令失败时,-s 标志可防止 npm 向您尖叫。它也不会创建 npm_debug.log 文件。

要自己测试差异,您可以在新目录中执行以下操作。

npm init -y
npm run test
npm run test -s

Note 1: I prefer to write npm run -s dev to limit possible confusion.

Note 2: To pass the -s flag to the dev script, you would run npm run dev -- -s.