When installing packages from NPM, you may see the
-s flag added to the
npm install command as follows:
npm install -s
-s flag is a shorthand for the
silent configuration, which sets the log level of your NPM installation process to nothing.
The following Terminal commands are all equal:
npm install -s npm install --silent npm install --loglevel silent
When you install NPM packages using the
-s flag, then NPM won’t log any output to the console. You won’t be able to know whether the installation is successful or not from the Terminal.
npm install command will show the following output:
$ npm install react added 4 packages, and audited 17 packages in 2s 2 packages are looking for funding run `npm fund` for details found 0 vulnerabilities $
npm install with the
-s flag will show no output at all:
$ npm install vue -s $
To know if your installation is successful, you need to open the
package.json file and see if the package name is listed as
Alternatively, you can open the
node_modules/ folder and check if a folder with the package name exists there.
Keep in mind that the npm command flag is case-sensitive. The lower case
-s flag is used to set the log level mode to silent, while the upper case
-S flag is used to save installed packages to a
package.json file as dependencies.
save configuration has been set to
true by default since NPM version 5.