Chen
Chen

Reputation: 147

How to handle duplicated name dependencies in package.json

in my package.json:

"dependencies": {
    "react-transition-group": "github:foo/react-transition-group",
    "react-transition-group": "^2.4.0",
}

the problem is I need to keep both of them, so is there any way to do that?

Upvotes: 2

Views: 2322

Answers (2)

Ali Zemani
Ali Zemani

Reputation: 141

use this :
npx sort-package-json

Upvotes: 0

David R
David R

Reputation: 15639

Try the dedupe command in CLI,

All you have to do is to execute the below command from your project's source directory where you have your package.json file,

npm dedupe

After executing this command you'll see the duplicate entries are getting removed in your package.json.

Upvotes: 4

Related Questions