Skip to content
Fix Code Error

What is the –save option for npm install?

March 13, 2021 by Code Error
Posted By: Anonymous

I saw some tutorial where the command was:

npm install --save

What does the --save option mean?

Not able to find the answer on Google.

Solution

Update npm 5:

As of npm 5.0.0, installed modules are added as a dependency by default, so the --save option is no longer needed. The other save options still exist and are listed in the documentation for npm install.

Original answer:

Before version 5, NPM simply installed a package under node_modules by default. When you were trying to install dependencies for your app/module, you would need to first install them, and then add them (along with the appropriate version number) to the dependencies section of your package.json.

The --save option instructed NPM to include the package inside of the dependencies section of your package.json automatically, thus saving you an additional step.

In addition, there are the complementary options --save-dev and --save-optional which save the package under devDependencies and optionalDependencies, respectively. This is useful when installing development-only packages, like grunt or your testing library.

Answered By: Anonymous

Related Articles

  • npm install error in vue
  • Form field border-radius is not working only on the…
  • Maven2: Missing artifact but jars are in place
  • Aurelia UX showcase app fails to load
  • Spring Boot - Cannot determine embedded database…
  • Error message "Forbidden You don't have permission…
  • Spring data jpa- No bean named…
  • UnsatisfiedDependencyException: Error creating bean…
  • Error: container has not been made global - how to solve?
  • Error: request entity too large
  • Laravel - npm run watch does not work on Lara 7,…
  • Svelte Cognito RollupJs error: 'Sha256' is not…
  • Tomcat 7 "SEVERE: A child container failed during start"
  • Error: Can't set headers after they are sent to the client
  • How to solve Internal Server Error in Next.Js?
  • using d3.js with aurelia framework
  • JUNIT @ParameterizedTest , Parameter resolution Exception
  • Which maven dependencies to include for spring 3.0?
  • TypeError: Cannot read property 'webpackJsonp' of undefined
  • Maven Could not resolve dependencies, artifacts…
  • What's the difference between dependencies,…
  • Vue js vuecli3 application does not work in ie11…
  • Vue&TypeScript: how to avoid error TS2345 when…
  • Angular and Typescript: Can't find names - Error:…
  • How should I deal with "package '✘✘✘' is not…
  • Eclipse Spring Boot need declare Maven dependency explicitly
  • GLYPHICONS - bootstrap icon font hex value
  • Runing vue/cli app under docker simple index.html is opened
  • The superclass "javax.servlet.http.HttpServlet" was…
  • Trouble with boxes appearing/hiding based on selection
  • Could not find module "@angular-devkit/build-angular"
  • How can I find the product GUID of an installed MSI setup?
  • How do I deal with installing peer dependencies in…
  • Exception in thread "JobGenerator"…
  • Problems Installing CRA & NextJS from NPM…
  • java.lang.ClassNotFoundException:…
  • Relative imports for the billionth time
  • VUE Error when run test unit
  • Building executable jar with maven?
  • Exception in thread "main"…
  • Starting ember server with ember cli
  • Python: importing a sub‑package or sub‑module
  • How can I manually compile a svelte component down…
  • Disable Logback in SpringBoot
  • Fontawesome fonts not loading using Aurelia, with…
  • "gatsby-source-airtable" threw an error while…
  • jQuery Ajax: Variable as Header key
  • ExpressJS How to structure an application?
  • yo polymer building error
  • Ember build failing
  • Flutter: RenderBox was not laid out
  • Include resource directory into Quarkus target output
  • Include an external css file in vuejs
  • Testing aurelia customElement with bindable and dependencies
  • How can I configure Storybook.js Webpack with…
  • Should I check in folder "node_modules" to Git when…
  • How do SO_REUSEADDR and SO_REUSEPORT differ?
  • Can't correctly import external JS into Aurelia…
  • What are the undocumented features and limitations…
  • How can I mock an ES6 module import using Jest?
  • Apache server keeps crashing, "caught SIGTERM,…
  • How to create and publish a Vuejs component on NPM
  • How to add Typescript to a Nativescript-Vue project?
  • Integrating Discogs disconnect node module in…
  • "The import org.springframework cannot be resolved."
  • Error creating bean with name 'entityManagerFactory'…
  • Unable to Build using MAVEN with ERROR - Failed to…
  • Error: ENOENT: no such file or directory…
  • Vagrant error : Failed to mount folders in Linux guest
  • Calculate the mean by group
  • vue/cli 3 unmet dependencies
  • Reference — What does this symbol mean in PHP?
  • Nuxt.js Cannot find module '@babel/preset-env/lib/utils'
  • Sass relative modules not found?
  • disabling spring security in spring boot app
  • Generating a drop down list of timezones with PHP
  • How to download javafx libraries for each operating…
  • Node.js Error: Cannot find module express
  • Moving away from bower in 2.15.1 ember-cli version
  • Replacing a 32-bit loop counter with 64-bit…
  • Google Forms file upload complete example
  • Aurelia CLI, babel runtime and async transforms
  • Casting to number from query fails. Node.js Express Mongoose
  • How can I configure Storybook.js Webpack to work…
  • Why does C++ code for testing the Collatz conjecture…
  • SystemJS (Aurelia with jspm) fails to load…
  • au build complains about file not found or accessible
  • How to observe embedded arrays in Ember objects?
  • Failed to execute goal…
  • NodeJS - Error installing with NPM
  • Trying to integrate Ant Design using Sass and…
  • How do I tell Maven to use the latest version of a…
  • Vue.js + Foundation + Webpack configuration
  • ember cli application build fails: The Broccoli…
  • Vue-CLI v3 opinionated project structure
  • ng serve is checking nodemodules in previous directory
  • What is your most productive shortcut with Vim?
  • Ember.js: rendering google chart in template (AKA…
  • Aurelia bundling issue with virtual directory
  • Npm run serve Error

Disclaimer: This content is shared under creative common license cc-by-sa 3.0. It is generated from StackExchange Website Network.

Post navigation

Previous Post:

How to comment multiple lines in Visual Studio Code?

Next Post:

How to close TCP and UDP ports via windows command line

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

.net ajax android angular arrays aurelia backbone.js bash c++ css dataframe ember-data ember.js excel git html ios java javascript jquery json laravel linux list mysql next.js node.js pandas php polymer polymer-1.0 python python-3.x r reactjs regex sql sql-server string svelte typescript vue-component vue.js vuejs2 vuetify.js

  • you shouldn’t need to use z-index
  • No column in target database, but getting “The schema update is terminating because data loss might occur”
  • Angular – expected call-signature: ‘changePassword’ to have a typedeftslint(typedef)
  • trying to implement NativeAdFactory imports deprecated method by default in flutter java project
  • What should I use to get an attribute out of my foreign table in Laravel?
© 2022 Fix Code Error