yarn npm and cpmp - Stack Overflow
迷茫
迷茫 2017-05-16 13:38:00
0
1
614

I have always used npm install or cpmp install to install dependencies. Later, yarn was recommended by many people. It seems that yarn is much more reliable than npm and cpmp, but I don’t know the reason. I checked a lot of related information, but there is no Not convincing. May I ask the master to show up and help clear up the confusion?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
洪涛

npm: npm is the official package management of node. Some personally developed packages can be uploaded through the relevant commands of npm, and others can be downloaded through the corresponding commands.

cnpm: Due to the domestic firewall, downloading content through npm will encounter problems such as failure or slow speed. Taobao has synchronized a set of domestic images of all packages on npm. Due to domestic reasons, the domestic download speed is very fast. Fast, except that the package cannot be published through cnpm, there is no difference from the other npm commands.

yarn: The main difference between it and npm is mainly reflected in yarn.lock. If there is no yarn.lock 的话,就会新建这么一个文件,并且锁定对应包的版本,如果当前项目根目录下有 yarn.lock in the project root directory, the version packaged in yarn.lock will be installed. For the version installed through the npm package, unless it is hard-coded in package.json, there is a risk of dynamic changes. Secondly,
yarn can be installed offline and is faster.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template