How to find out the minimum version of node.js for my project?

Does the NPM have a command to indicate the minimum dependency of the Node version based on the available project modules?

+4
source share
3 answers

No. There is no built-in way to recursively check the current package and its dependencies and compare the requirement engines.nodeinto a single whole.

If you are using a Unix-like system, you can try this command:

find . -name package.json | xargs grep -h node\": | sort | uniq -c

This will give you something like this output:

    1     "gnode": "0.1.0",
    36     "node": "*"
    1     "node": "0.10.x || 0.8.x"
    1     "node": "0.4 || >=0.5.8"
    1     "node": ">= 0.10.0"
    3     "node": ">= 0.4"
    3     "node": ">= 0.4.0"
    2     "node": ">= 0.4.1 < 0.5.0"
    2     "node": ">= 0.6"
    1     "node": ">= 0.6.6"
    8     "node": ">= 0.8"
    3     "node": ">= 0.8.0"
    1     "node": ">=0.1.90"
    2     "node": ">=0.10.0"
    5     "node": ">=0.4"
    9     "node": ">=0.4.0"
    3     "node": ">=0.4.12"
    3     "node": ">=0.4.9"
    5     "node": ">=0.6"
    5     "node": ">=0.8"
    19     "node": ">=0.8.0"
    1     "node": ">=0.8.x"
    1   "engines": { "node": ">= 0.4.0" }
    1   , "dnode": "10.999.14234"

( "gnode" "dnode" ) , - "0.10", node ('*').

, package.json , , :

find . -name package.json | xargs grep node\":
+5

package.json :

  "engines": {
    "node": ">=0.10.0"
  }
0

I think you should try the npm ls command

0
source

All Articles