Different between npm install, npm install --save and npm install --save-dev
When use npm to manage package, will use --save and --save-dev, this topic used vuex as example to show the different
{ 1. npm install vuex }
In short it's one time install, will not change package.json, if you removed the package can not reinstall with npm install command, so only use it for no need repeat package
{ 2. npm install vuex --save }
this command will change package.json, and add vuex to "dependencies" section, usually use this command to install core package for web app run, like: vue, vue-router
{ 3. npm install vuex --save-dev }
this command will change package.json, and add vuex to "devDependencies", usually use this command to install dev support package, like: file-loader, webpack
Leave Comment