I saw the following command that includes -s
option. What does it(-s
) mean? Because I didn't see the option in package.json
.
$ npm run dev -s
I saw the following command that includes -s
option. What does it(-s
) mean? Because I didn't see the option in package.json
.
$ npm run dev -s
The flag -s
stands for "silent" and is applied to npm
, not to the command in the dev
script.
The -s
flag prevents npm
from screaming at you when the command exits with a non-zero status, i.e. when the command fails. It also won't create an npm_debug.log file.
To test out the difference yourself you can do the following in a new directory.
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 thedev
script, you would runnpm run dev -- -s
.