yarn和npm命令对比

2020-05-25 16:56:02

参考地址 yarn 基本用法

1、初始化一个新的项目

yarn init

2、添加一个依赖包

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

3、安装所有的依赖包

yarn 或者 yarn install

4、npm 与 yarn命令比较

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


  • 2021-01-15 13:30:21

    MongoDb web 用户界面

    MongoDB 的 Web 界面访问端口比服务的端口多1000。 如果你的MongoDB运行端口使用默认的27017,你可以在端口号为28017访问web用户界面,即地址为:http://localhost:28017。

  • 2021-01-16 09:31:14

    Xcode两种引入图片的方法

    如果是纯代码,图片名需要手动添加@2x,@3x等倍数标识,且需要指明后缀.png,.jpg;IB添加图片的话只需要指明后缀就好,不用添加倍数标识。

  • 2021-01-16 09:39:32

    iOS 更改状态栏、导航栏颜色,电池颜色

    注意事项,两种方法设置View controller-based status bar appearance 的值不一样,并且如果你的plist里面没有View controller-based status bar appearance,你需要新建一个。然后就可以成功了。

  • 2021-01-16 09:45:19

    tabbar的titlePositionAdjustment设置文字距离

    指定相应的数据去偏移一个位置,向右或者向下为正值,向左或者向上为负值,不过首先你得有一个相对位置的坐标。而tabbarItem文字的坐标是底部为x轴,y轴则是tabbarItem的centerX;