What does the -S
flag for npm mean? I see it referenced here but https://docs.npmjs.com/cli/install does not cover what the -S
is.
npm i -S @types/google-apps-script
To use the npm init command, use the below command: 1. npm init # This will trigger the initialization. However, if you want to accept the prompts that come from npm init automatically, then use the –yes flag on the npm init command. It will populate all the options automatically with the default npm init values.
Introduction to npm Npm stands for Node Package Manager. It is a package manager for the Node JavaScript platform. Npm is known as the world's largest software registry.
the -g flag means install the package globally on your system.
The --save flag no longer serves a purpose. Previously, as the other answers noted, the --save flag would update the dependencies in the project's package. json file, but npm install now includes this functionality by default.
-S
is shorthand for --save
, and it adds the package you're installing to the dependencies in your package.json
file (which can be created with npm init
). However, --save
or -S
is totally unnecessary if you're using npm 5 or above since it's done by default.
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