npm install accepts 3 exclusive, optional flags that save or update the package version in your main package. json:
-S, --save: the package will appear in your dependencies.
-D, --save-dev: the package will appear in your devDependencies.
-O, --save-optional: The package will appear in your advanced options.
When using any of the above options to save dependencies with your .json package, there is an additional optional flag:
-E, --save-exact: saved dependencies will be configured with the exact version, and not with the default nver operator. Also, if you have npm-shrinkwrap.json, it will also be updated.
<scope> is optional. The package will be downloaded from the registry associated with the specified area. If the registry is not associated with this area, it is assumed that the default registry is used. See Npm-scope.
Note. If you do not specify an @ -symbol in your realm name, npm will interpret this as a GitHub repository, see below. Area names must also be followed by a slash.
Examples:
npm install sax --save npm install githubname / reponame npm install @ myorg / privatepackage npm install node -tap --save-dev npm install dtrace-provider --save-optional npm install readable-stream --save --save-exact
Note. If there is a file or folder with the name <name> in the current working directory, then he will try to install it and try to get the package by name if it is not valid.
(from white papers) https://docs.npmjs.com/cli/install
Orange webdev
source share