What's the purpose of an "-s"
flag in "npm run -s build"
? I've searched in npm docs, but can't find, Is this an alias for "--silent"
flag?
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.
npm run sets the NODE environment variable to the node executable with which npm is executed. If you try to run a script without having a node_modules directory and it fails, you will be given a warning to run npm install , just in case you've forgotten.
According to: https://github.com/npm/npm/blob/5e426a78ca02d0044f8dd26e0c5f881217081cbd/doc/misc/npm-config.md
Shorthands and Other CLI Niceties
-s, --silent: --loglevel silent
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With