NPM basic command

Time:2020-11-22

NPM basic command

npm install xxx

The XXX module is installed but not recorded to package.json in

NPM install XXX @ version number

Install the XXX module with the specified version number

npm install –save xxx

Install XXX module and record to package.json The dependency corresponding to the field is a module that the product environment must rely on

npm install –save-dev xxx

Install XXX module and record to package.json The dev dependency corresponding to the field is a module that the development environment must rely on

npm install –global xxx

Global installation of XXX module, not recorded to package.json

npm uninstall xxx
Delete XXX module

npm uninstall -g xxx
Delete XXX module globally