Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What does the command `npm i -S packagename` do and what is the yarn equivalent to this npm command?

What does -S stand for in an npm command? And where the added package is added in package.json? in "devDependencies" or in "dependencies" collection?

I have seen other questions like the ones below, but none of them refers to my question:

What is the equivalent of "npm install <package_name> –save" in Yarn?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

What does the npm -S flag mean?

>Solution :

See npm install --help (or https://docs.npmjs.com/cli/v9/using-npm/config): -S means --save which has been true by default since like forever, and is documented as:

Save installed packages to a package.json file as dependencies.

Contrary to --save-dev:

Default: false

Save installed packages to a package.json file as devDependencies.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading