What does -s mean in npm command?

为君一笑 提交于 2019-12-11 07:34:08

问题


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 dev to limit possible confusion.

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



来源:https://stackoverflow.com/questions/41383247/what-does-s-mean-in-npm-command

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!