Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 314 Vote(s) - 3.49 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How does NPM handle version conflicts?

#1
Since NPM version 3 node modules and dependencies are all installed at the same root level. But what if I install two modules that depend on two different versions of the same module? For instance, if I install async `npm i [email protected]`, which [requires lodash version 4.14.0][1], then I install yeoman `npm i [email protected]`, which [requires lodash version version 3.2.0][2], how does npm resolve this conflict?


[1]:

[To see links please register here]

[2]:

[To see links please register here]

Reply

#2
All the dependencies and the internal dependencies tries to get a place in the root of the `node_modules` unless there is a conflict with the same dependency, but different version. **When a conflict raises, it creates a sub `node_modules` under each dependency needed** and pushes conflicting internal libraries in it.

EXAMPLE:
Here, "A" internally depends on "[email protected]" and "B" depends on "[email protected]".
When you execute install A and B like below:

```
npm install A
npm install B

node_modules
|_ A
|_ alpha @v1.0
|_ B
| |_ node_modules
| |_ alpha @v2.0
|_ ...
```

NOTE: Another `node_modules` created under "B" inside the main node_module.

For more details: [visit this post][1].


[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through