Question: How to resolve the conflict of dependent package versions in npm package management?

  node.js, question

I have a question: generally there is one in the project directory.package.jsonFile, which contains the package to be imported. After installation, the dependent package will be downloaded tonode_modulesBelow the directory, but if the packages depend on each other, and there are different versions depending on the same package, what should we do then, isn’t this a conflict?

For example, I want to introduceABags andBPackage, they also rely on at the same timeCBags,Arely onC 1.0.0Version,Brely onC 2.0.0Version, then thisCDoes the package not conflict, ifnode_modulesThe package directory under the directory should have the version number, otherwise what can I do?

Npm has helped you solve these problems. You need not worry, just use it.

Npm2 is node_modules that install all dependencies into the module directory in turn, which also leads to too deep a directory under win to delete many times.
Npm3 depends on parallel installation, but different versions are still installed under their own modules. At the same time, a directory with version number will be created under the root node_modules.