yarn的使用

简介: yarn的使用

安装

npm i -g yarn

使用

常用命令

yarn add package // 安装依赖
yarn global add package // 全局安装依赖
yarn add package -D // 安装开发依赖
yarn remove package // 移除依赖

设置yarn国内源

yarn config set registry https://registry.npm.taobao.org/

设置yarn中node-sass的地址

yarn config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass -g

yarn全部命令

Usage: yarn [command] [flags]
  Displays help information.
  Options:
    --cache-folder <path>               specify a custom folder that must be used to store the yarn cache
    --check-files                       install will verify file tree of packages for consistency
    --cwd <cwd>                         working directory to use (default: E:\workspace\asset-management)
    --disable-pnp                       disable the Plug'n'Play installation
    --emoji [bool]                      enable emoji in output (default: false)
    --enable-pnp, --pnp                 enable the Plug'n'Play installation
    --flat                              only allow one version of a package
    --focus                             Focus on a single workspace by installing remote copies of its sibling workspaces.
    --force                             install and build packages even if they were built before, overwrite lockfile
    --frozen-lockfile                   don't generate a lockfile and fail if an update is needed
    --global-folder <path>              specify a custom folder to store global packages     
    --har                               save HAR output of network traffic
    --https-proxy <host>
    --ignore-engines                    ignore engines check
    --ignore-optional                   ignore optional dependencies
    --ignore-platform                   ignore platform checks
    --ignore-scripts                    don't run lifecycle scripts
    --json                              format Yarn log messages as lines of JSON (see jsonlines.org)
    --link-duplicates                   create hardlinks to the repeated modules in node_modules
    --link-folder <path>                specify a custom folder to store global links        
    --modules-folder <path>             rather than installing modules into the node_modules 
folder relative to the cwd, output them here
    --mutex <type>[:specifier]          use a mutex to ensure only one yarn instance is executing
    --network-concurrency <number>      maximum number of concurrent network requests        
    --network-timeout <milliseconds>    TCP timeout for network requests
    --no-bin-links                      don't generate bin links when setting up packages    
    --no-default-rc                     prevent Yarn from automatically detecting yarnrc and 
npmrc files
    --no-lockfile                       don't read or generate a lockfile
    --non-interactive                   do not show interactive prompts
    --no-node-version-check             do not warn when using a potentially unsupported Node version
    --no-progress                       disable progress bar
    --offline                           trigger an error if any required dependencies are not available in local cache
    --otp <otpcode>                     one-time password for two factor authentication      
    --prefer-offline                    use network only if dependencies are not available in local cache
    --preferred-cache-folder <path>     specify a custom folder to store the yarn cache if possible
    --prod, --production [prod]
    --proxy <host>
    --pure-lockfile                     don't generate a lockfile
    --registry <url>                    override configuration registry
    -s, --silent                        skip Yarn console logs, other types of logs (script output) will be printed
    --scripts-prepend-node-path [bool]  prepend the node executable dir to the PATH in scripts
    --skip-integrity-check              run install without checking if node_modules is installed
    --strict-semver
    --update-checksums                  update package checksums from current repository     
    --use-yarnrc <path>                 specifies a yarnrc file that Yarn should use (.yarnrc only, not .npmrc) (default: )
    -v, --version                       output the version number
    --verbose                           output verbose messages on internal operations       
    -h, --help                          output usage information
  Commands:
    - access
    - add
    - audit
    - autoclean
    - bin
    - cache
    - check
    - config
    - create
    - exec
    - generate-lock-entry / generateLockEntry
    - global
    - help
    - import
    - info
    - init
    - install
    - licenses
    - link
    - list
    - login
    - logout
    - node
    - outdated
    - owner
    - pack
    - policies
    - publish
    - remove
    - run
    - tag
    - team
    - unlink
    - unplug
    - upgrade
    - upgrade-interactive / upgradeInteractive
    - version
    - versions
    - why
    - workspace
    - workspaces

目录
打赏
0
0
0
0
4
分享
相关文章
Playwright测试中避免使用no-wait-for-timeout的原因
在Web应用自动化测试中,Playwright作为首选框架,其稳定性至关重要。不当使用`no-wait-for-timeout`会导致测试结果不稳定、不符合真实用户体验且难以调试。推荐采用显式等待策略和合理设置超时时间,结合代理IP技术提高测试成功率和数据多样性。示例代码展示了如何在Playwright中配置代理IP进行数据抓取及分类统计。遵循这些最佳实践可确保测试既可靠又贴近实际用户场景。
616 4
Playwright测试中避免使用no-wait-for-timeout的原因
|
5月前
2024阿里云技术年报 基础设施篇
2024阿里云技术年报 基础设施篇
138 11
NAS极速远程访问!贝锐花生壳推出飞牛fnOS专属内网穿透服务
贝锐花生壳与飞牛私有云fnOS合作,推出专属客户端及映射服务,实现3倍传输速率提升。用户只需在fnOS应用中心搜索“花生壳”,一键安装即可享受高速、稳定、安全的远程NAS访问体验。
860 9
Linux系统编程教程之Linux线程函数的使用:讲解Linux线程函数
Linux系统编程教程之Linux线程函数的使用:讲解Linux线程函数
145 1
MySQL MATCH 匹配中文 无法查询的问题如何处理?
【8月更文挑战第29天】MySQL MATCH 匹配中文 无法查询的问题如何处理?
506 7
【深入浅出 RocketMQ原理及实战】「底层源码挖掘系列」透彻剖析贯穿一下RocketMQ和Kafka索引设计原理和方案
【深入浅出 RocketMQ原理及实战】「底层源码挖掘系列」透彻剖析贯穿一下RocketMQ和Kafka索引设计原理和方案
277 1
【C++ 文件操作与字符串处理】从文件读取到内容分割的全方位指南
【C++ 文件操作与字符串处理】从文件读取到内容分割的全方位指南
1034 6

热门文章

最新文章

AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等