美文网首页
全局相关

全局相关

作者: 熊猫小熊 | 来源:发表于2020-11-03 14:38 被阅读0次

    # 添加全局包

    npm i yarn -g

    # 查看全局安装了哪些包

    npm list -g --depth 0

    ~~~

    +-- @hs/sfe-cli@2.4.1

    +-- anywhere@1.5.0

    +-- create-react-app@4.0.0

    +-- nodemon@2.0.6

    `-- yarn@1.22.10

    ~~~

    注: 如果不加 --depth 0,则会展示全部层级

    如: 

    ~~~

     +-- metalsmith@2.3.0

    | | +-- absolute@0.0.1

    | | +-- chalk@1.1.3

    | | | +-- ansi-styles@2.2.1

    | | | +-- escape-string-regexp@1.0.5 deduped

    | | | +-- has-ansi@2.0.0

    | | | | `-- ansi-regex@2.1.1

    | | | +-- strip-ansi@3.0.1

    ....

    ~~~

    # 查看全局是否安装了某个包

    npm ls yarn -g

    如果有就会打印如:

    ~~~

    `-- yarn@1.22.10

    ~~~

    注: 如果不加-g就表示查看当前文件下

    # 移除全局包

    npm uninstall yarn -g

    相关文章

      网友评论

          本文标题:全局相关

          本文链接:https://www.haomeiwen.com/subject/irnbvktx.html