问题
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
回答1:
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 devto limit possible confusion.Note 2: To pass the
-sflag to thedevscript, you would runnpm run dev -- -s.
来源:https://stackoverflow.com/questions/41383247/what-does-s-mean-in-npm-command