如何列出 npm 用户安装的软件包? [英] How to list npm user-installed packages?

查看:33
本文介绍了如何列出 npm 用户安装的软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何仅在 npm 中列出用户安装的软件包?当我执行 npm -g list 时,它会输出每个包及其依赖项,这不是我想要的.

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 want.

推荐答案

npm list -g --depth=0

  • npm:Node 包管理器命令行工具
  • list -g:显示在用户文件夹中找到的每个包的树(没有 -g 选项,它只显示当前目录的包)
  • --depth 0/--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
    • 这篇关于如何列出 npm 用户安装的软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆