yarn role and npm exactly the same, but from the experience of speaking, yarn superior; moreover, RN can only use yarn packages installed, do not use cnpm or npm;
-
yarn init -y
It represents a fast initialization packet management configuration file, if the project does not initialize on-pack, there will be attached to the issue under the user directory; -
Run-pack
yarn add jquery
, or -S --save not need to specify where, because yarn is installed by default dependencies to the next node; -
Running yarn add webpack -D, -D here, it means, the corresponding packet, is mounted to the lower devDependencies node;
-
Run
yarn remove 包名
can uninstall package, at the same time, the package will be automatically recorded information package.json deleted; -
Run
yarn
can be installed in all the records in package.json package;