Print a list of all installed node.js modules

后端 未结 7 2055
情话喂你
情话喂你 2020-12-22 17:29

In a node.js script that I\'m working on, I want to print all node.js modules (installed using npm) to the command line. How can I do this?

console.log(__fil         


        
7条回答
  •  南笙
    南笙 (楼主)
    2020-12-22 17:47

    If you are only interested in the packages installed globally without the full TREE then:

    npm -g ls --depth=0

    or locally (omit -g) :

    npm ls --depth=0

提交回复
热议问题