Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the npm -S flag mean?

Tags:

npm

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
like image 340
IMTheNachoMan Avatar asked Sep 04 '19 17:09

IMTheNachoMan


People also ask

What is flag in npm init?

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.

What does npm I stand for?

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.

What is the G flag for terminal?

the -g flag means install the package globally on your system.

What does save flag do npm install?

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.


1 Answers

-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.

like image 56
nCardot Avatar answered Sep 21 '22 20:09

nCardot