www.cnblogs.com/cina33blogs…

NPM I module_name -s => NPM install module_name --save in the dependencies object NPM I module_name -d => NPM install Module_name --save-dev is written to the devDependencies object NPM I module_name -g global installCopy the code

I is short for install

-s is short for –save

-d is –save-dev, and the package name and version number are stored in devDependencies in package.json, while –save puts the package name and version number in dependencies.

When we install modules or plugins using NPM install, we have two commands to write them into the package.json file, such as:

–save-dev

–save

The difference between a package.json file is that plugins installed with –save-dev are written to the devDependencies object, whereas plugins installed with –save are written to the Dependencies object.

What’s the difference between the devDependencies and Dependencies objects in the package.json file?

The plug-ins in devDependencies are for the development environment only, not for the production environment, whereas in Dependencies you need to publish to the production environment.