首页 > 其他 > 详细

yarn 的使用 及 npm 命令对比

时间:2020-12-14 14:32:52      阅读:20      评论:0      收藏:0      [点我收藏+]

 

1、初始化一个新的项目

yarn init

2、添加一个依赖包

yarn add [package]
yarn add [package]@[version]
yarn add [package]@[tag]

3、安装所有的依赖包

yarn 或者 yarn install

4、npm 与 yarn命令比较

NPMYARN说明
npm init yarn init 初始化某个项目
npm install/link yarn install/link 默认的安装依赖操作
npm install taco —save yarn add taco 安装某个依赖,并且默认保存到package.
npm uninstall taco —save yarn remove taco 移除某个依赖项目
npm install taco —save-dev yarn add taco —dev 安装某个开发时依赖项目
npm update taco —save yarn upgrade taco 更新某个依赖项目
npm install taco --global yarn global add taco 安装某个全局依赖项目
npm publish/login/logout yarn publish/login/logout 发布/登录/登出,一系列NPM Registry操作
npm run/test yarn run/test 运行某个命令

 

 

 

 

.

yarn 的使用 及 npm 命令对比

原文:https://www.cnblogs.com/xiangsj/p/14132496.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!