yarn 和 npm 的区别

包管理工具的安装:

yarn的安装:

下载软件,傻瓜式安装。

注(PS):

用npm进行安装yarn会报错,不能使用

npm的安装:

安装node之后 自动安装了npm

包管理工具在项目中常用命令:yarn 和 npm

1、查看版本    yarn --version    npm -version(或者 node -v) 2、安装淘宝镜像    yarn configsetregistry'https://registry.npm.taobao.org'npm install -g cnpm --registry=http://registry.npm.taobao.org 3、初始化某个项目    yarn init                                                      npm init 4、默认安装项目依赖      yarn install                                                cnpm install 5、安装某个依赖,并且默认保存到package      yarn add xxx                                              cnpm install xxx --save 6、卸载某个项目依赖      yarn remove xxx                                        cnpm uninstall xxx --save 7、更新某个项目依赖      yarn upgrade xxx                                        cnpm update xxx --save 8、安装某个全局的项目依赖      yarn global add xxx                                    cnpm install xxx -g 9、安装某个特定版本号的项目依赖      yarn add xxx@                                            cnpm install [email protected] --save 10、发布/登录/登出,一系列NPM Registry操作    yarn publish/login/logoutnpm publish/login/logout11、运行某个命令      yarn run/testnpm run/test

拓展: https://www.cnblogs.com/mumusen/p/9760732.html

你可能感兴趣的:(yarn 和 npm 的区别)