I am trying to ls
only the production dependencies from package.json
following the docs
So I am doing
npm list -depth 0 -prod
or
npm list -depth 0 -only prod
But npm seems to ignore it and it lists both dependencies
and devDependencies
Any idea how I can achieve that?
I found out that the command is not supported on 3.7.3
so I updated my npm version to 3.8.7
and the following command does the job
npm list -prod -depth 0
npm list -depth 0 -prod true
Lists the dependencies and npm list -depth 0 -dev true
lists the devDependencies. Those work for me. You are missing the true
after the -prod
or -dev
flag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With