V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
InFaNg
V2EX  ›  Node.js

使用 cnpm 安装的包如何更新

  •  
  •   InFaNg · May 12, 2016 via Android · 5756 views
    This topic created in 3641 days ago, the information mentioned may be changed or developed.
    能用 npm update 更新吗?如果不行,怎么办
    6 replies    2016-06-01 12:58:56 +08:00
    dotnil
        1
    dotnil  
       May 15, 2016
    cnpm update ?指定新版本 install 也可以把, cnpm install xxx@v
    InFaNg
        2
    InFaNg  
    OP
       May 15, 2016 via Android
    @dotnil cnpm update 貌似失效了,不知道和 npm update 到一半电脑没电了有没有关系。跟麻烦的是我一部分是用 npm 装的,一部分是用 cnpm 装的。
    dotnil
        3
    dotnil  
       May 16, 2016
    @InFaNg cnpm 应该是 npm 的完整镜像把,理论上全都通过 cnpm 安装也不会有啥问题
    1990andy
        4
    1990andy  
       May 30, 2016
    建议还是宁可翻墙用 npm 。。。。
    m31271n
        5
    m31271n  
       Jun 1, 2016   ❤️ 1
    推荐使用通过 alias 的方式使用 cnpm : npm list --depth 0 列出所有明确安装的包并记录下来。然后删除 node_modules ,
    m31271n
        6
    m31271n  
       Jun 1, 2016   ❤️ 1
    推荐使用通过 alias 的方式使用 cnpm :
    ```
    alias cnpm="npm --registry=https://registry.npm.taobao.org \
    --cache=$HOME/.npm/.cache/cnpm \
    --disturl=https://npm.taobao.org/dist \
    --userconfig=$HOME/.cnpmrc"
    ```

    npm list --depth 0 列出所有明确安装的包并记录下来,然后删除 node_modules 。

    使用 cnpm 重新安装所有包。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2507 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 12:20 · PVG 20:20 · LAX 05:20 · JFK 08:20
    ♥ Do have faith in what you're doing.