zoukankan      html  css  js  c++  java
  • yarn的安装与使用及与npm对应的命令

    在Nodejs环境下,通过npm install -g yarn 命令进行全局安装

    例如:
    yarn version
    yarn init
    yarn install
    yarn add vue
    yarn add vue-router
    yarn remove vue-router


    CLI 命令比较


    npm Yarn
    npm install yarn install
    (N/A) yarn install --flat
    (N/A) yarn install --har
    (N/A) yarn install --no-lockfile
    (N/A) yarn install --pure-lockfile
    npm install [package] (N/A)
    npm install --save [package] yarn add [package]
    npm install --save-dev [package] yarn add [package] [--dev/-D]
    (N/A) yarn add [package] [--peer/-P]
    npm install --save-optional [package] yarn add [package] [--optional/-O]
    npm install --save-exact [package] yarn add [package] [--exact/-E]
    (N/A) yarn add [package] [--tilde/-T]
    npm install --global [package] yarn global add [package]
    npm rebuild yarn install --force
    npm uninstall [package] (N/A)
    npm uninstall --save [package] yarn remove [package]
    npm uninstall --save-dev [package] yarn remove [package]
    npm uninstall --save-optional [package] yarn remove [package]
    npm cache clean yarn cache clean
    rm -rf node_modules && npm install yarn upgrade
    参考地址:https://yarnpkg.com/zh-Hans/


    ---------------------

    最常用的命令:

    初始化新项目

    yarn init
    

    添加依赖包

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

    将依赖项添加到不同依赖项类别

    分别添加到 devDependenciespeerDependencies 和 optionalDependencies

    yarn add [package] --dev
    yarn add [package] --peer
    yarn add [package] --optional
    

    升级依赖包

    yarn upgrade [package]
    yarn upgrade [package]@[version]
    yarn upgrade [package]@[tag]
    

    移除依赖包

    yarn remove [package]
    

    安装项目的全部依赖

    yarn
    

    或者

    yarn install

  • 相关阅读:
    页面出现Incorrect string以及数据库内容乱码
    页面中的导航监测
    基于.NET平台常用的框架整理
    强化学习-简介
    强化学习五大方面-奖励与策略结构
    强化学习五大方面-环境
    MSP430G2ET时钟系统
    java每日一练 2020.7.27
    Java多线程
    java每日一练 2020.7.26
  • 原文地址:https://www.cnblogs.com/bluestorm/p/9814141.html
Copyright © 2011-2022 走看看