V
V
Vadim2021-10-18 13:55:21
npm
Vadim, 2021-10-18 13:55:21

What version of the package will be installed?

I want to understand how npm builds a dependency tree. There is a react application with many different packages and their dependencies - in particular, "ansi-regex" is installed as dependencies in different places in the package-lock.json file. What version of ansi-regex is eventually installed and why?

"dependencies": {
        "ansi-regex": {
          "version": "5.0.1",
          "resolved": "XXXXX/-/ansi-regex-5.0.1.tgz",
          "integrity": "sha512-quJQXlTSUGL2LH9SUXo8V4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="
        },
        
        "strip-ansi": {
          "version": "3.0.1",
          "resolved": "XXXXX/-/strip-ansi-3.0.1.tgz",
          "integrity": "sha1-ajhfuIU9lS1fOiq+UJ43GPc8=",
          "dev": true,
          "requires": {
            "ansi-regex": "^2.0.0"
          },
          
        "pretty-format": {
          "version": "26.6.2",
          "resolved": "XXXXXX/-/pretty-format-26.6.0.tgz",
          "integrity": "sha512-7CYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==",
          "requires": {
            "@jest/types": "^26.6.0",
            "ansi-regex": "^5.0.0",
            "ansi-styles": "^4.0.1",
            "react-is": "^17.0.2"
          },

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question