How to list npm user-installed packages?

前端 未结 15 2203
后悔当初
后悔当初 2020-12-02 03:09

How do I list the user-installed package ONLY in npm? When I do npm -g list it outputs every package and their dependencies, which is not what I wa

相关标签:
15条回答
  • 2020-12-02 03:56

    For Local module usenpm list --depth 0

    Foe Global module npm list -g --depth 0

    Example local npm module Example global npm module

    0 讨论(0)
  • 2020-12-02 03:59

    Use npm list and filter by contains using grep

    Example:

    npm list -g | grep name-of-package
    
    0 讨论(0)
  • 2020-12-02 04:04

    This works pretty well too: npm list -g --depth=0

    • npm: the Node package manager command line tool
    • list -g: display a tree of every package found in the user’s folders (without the -g option it only shows the current directory’s packages)
    • depth 0 / — depth=0: avoid including every package’s dependencies in the tree view
    0 讨论(0)
提交回复
热议问题