V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
xcatliu
V2EX  ›  程序员

「CYarn」使用 cnpm 源的 Yarn

  •  
  •   xcatliu ·
    xcatliu · 2016-10-13 11:44:05 +08:00 · 6706 次点击
    这是一个创建于 2751 天前的主题,其中的信息可能已经有所发展或是发生改变。

    做的比较匆忙,请大家帮忙多测试一下,谢谢!

    GitHub: https://github.com/xcatliu/cyarn


    CYarn

    使用 cnpm 源的 Yarn

    Yarn 是一个快速、可靠、安全的 JavaScript 依赖管理工具。

    • Yarn 文档: https://yarnpkg.com/ (官方网站支持多语言,但是中文文档还没有)

    安装 CYarn

    npm install -g cyarn
    

    或者使用 cnpm 源:

    npm install -g cyarn --registry=https://registry.npm.taobao.org
    

    现有技术

    CYarn 离不开这些现有技术:

    第 1 条附言  ·  2016-10-13 12:54:26 +08:00
    ## 其他修改源的方式

    ### 配置 yarn config

    https://yarnpkg.com/en/docs/cli/config

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

    ### 使用 yrm

    https://github.com/i5ting/yrm

    ```shell
    npm install -g yrm
    yrm use cnpm
    ```
    loading
        1
    loading  
       2016-10-13 11:46:36 +08:00 via Android
    项目名就被抢了……
    airycanon
        2
    airycanon  
       2016-10-13 11:54:41 +08:00
    要不要这样……
    DoraJDJ
        3
    DoraJDJ  
       2016-10-13 11:59:29 +08:00 via Android
    猝不及防
    毫无防备
    guokeke
        4
    guokeke  
       2016-10-13 12:00:51 +08:00 via Android
    cyarn 。。好快
    Numbcoder
        5
    Numbcoder  
       2016-10-13 12:07:57 +08:00   ❤️ 5
    echo 'registry "https://registry.npm.taobao.org"' > ~/.yarnrc

    一句话加个配置的事,确非要「占坑」,搞一个新 package 出来
    有那么多闲时间不如去做点有意义的事,有能力就去贡献点有意义的代码,占坑这种风气真的不好

    npm 上有太多占着茅坑不拉屎的包了!
    xcatliu
        6
    xcatliu  
    OP
       2016-10-13 12:27:32 +08:00
    @Numbcoder
    多谢提醒,我一会儿把 yarn config set registry 的方式也写到 README.md 里面去。
    xxxyyy
        7
    xxxyyy  
       2016-10-13 12:30:57 +08:00 via Android
    看了楼主的主页描述,很难想象一个 M$ 的 SE 居然也做这种取巧的事,为什么不直接去原项目贡献代码呢?
    xcatliu
        8
    xcatliu  
    OP
       2016-10-13 12:32:32 +08:00
    @xxxyyy 请问是哪段主页描述?
    xcatliu
        9
    xcatliu  
    OP
       2016-10-13 12:54:15 +08:00
    @Numbcoder 已加

    ## 其他修改源的方式

    ### 配置 yarn config

    https://yarnpkg.com/en/docs/cli/config

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

    ### 使用 yrm

    https://github.com/i5ting/yrm

    ```shell
    npm install -g yrm
    yrm use cnpm
    ```
    xxxyyy
        10
    xxxyyy  
       2016-10-13 13:36:37 +08:00 via Android
    eoo
        11
    eoo  
       2016-10-13 14:05:21 +08:00 via Android
    卧槽 这么快 C 版就出来了?
    xcatliu
        12
    xcatliu  
    OP
       2016-10-13 14:18:40 +08:00
    @xxxyyy 哦我理解错了,我以为你是说看到主页上写了什么才吐槽我的。

    你的批评我接受,我确实有一些取巧的部分,以后会更注重实质性的贡献。只希望这个能给一些人带来价值吧。
    另外,请就事论事,这个 repo 和我在不在 M$ 没有关系。请不要随意给别人戴帽子,谢谢。
    xxxyyy
        13
    xxxyyy  
       2016-10-13 15:07:50 +08:00 via Android
    @xcatliu 我并不是指与 M$ 有和关系,我只是觉得既然可以在 M$ 上班的,能力上是没什么问题的,那为什么不去做点与之能力相匹配的事呢?当然这只是我的想法,你也可以不 care 。
    xcatliu
        14
    xcatliu  
    OP
       2016-10-13 15:31:34 +08:00
    @xxxyyy 欢迎你了解一下我做的其他事情,虽然称不上大牛,但是一直以积极的态度参与开源和分享的。

    https://github.com/xcatliu
    http://blog.xcatliu.com
    https://www.v2ex.com/member/xcatliu/topics
    cr217
        15
    cr217  
       2016-10-13 16:20:58 +08:00
    速度服了。。。
    KiriGiri
        16
    KiriGiri  
       2016-10-13 17:05:55 +08:00
    神速啊。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1232 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 23:17 · PVG 07:17 · LAX 16:17 · JFK 19:17
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.