


#How to use npm install
When NPM install is executed, the command line will print out all the installed dependencies. The output information of NPM is lengthy. Only when this file exists will the packages version information be recorded and updated 3. The difference between NPM and yarn is that yarn generates such a lock file by default, while NPM generates the npm-shrinkwrap.json file through the shrinkwrap command. This is the same reason that yarn reads yarn.lock file. When NPM install is executed, the lock file will be read first. NPM actually has a way to use the same version of packages everywhere, but the developer needs to execute the NPM shrinkwrap command. This ensures that every time you pull the same project dependency, you use the same module version. Each time a new module is added, yarn will create (or update) the yarn. In order to prevent pulling different versions, yarn has a lock file that records the version number of the module exactly installed.
#How to use npm software
Offline mode: if a software package has been installed before and is retrieved from the cache when using yarn to install it again, you don’t need to download it from the network like NPM 2. Yarn performs all tasks synchronously, which improves performanceġ.2.

NPM is to execute each package according to the queue, that is to say, it must wait until the current package installation is completed before the subsequent installation can continue. The fast speed mainly comes from the following two aspects:ġ.1 parallel installation: both NPM and yarn will perform a series of tasks when installing packages. As written in the official document, yarn appears to make up for some defects of NPM 2. Yarn is a new JS package management tool jointly launched by Facebook, Google, exponent and tilde.
