LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

npm-dedupe

reduces duplication in the package tree by moving dependencies higher

TLDR

Deduplicate dependencies
$ npm dedupe
copy
Dry run (show what would change)
$ npm dedupe --dry-run
copy
Include dev dependencies
$ npm dedupe --include=dev
copy
Dedupe with legacy bundling
$ npm dedupe --legacy-bundling
copy

SYNOPSIS

npm dedupe [options]

DESCRIPTION

npm dedupe reduces duplication in the package tree by moving dependencies higher in the tree where they can be shared. This can reduce node_modules size significantly.The command restructures but doesn't change package-lock.json versions.

PARAMETERS

--dry-run

Show changes without applying.
--include type
Include dependency type.
--omit type
Omit dependency type.
--legacy-bundling
Use legacy algorithm.
--strict-peer-deps
Fail on peer dep issues.

EXAMPLE

$ # Before dedupe
node_modules/
├── a/
│   └── node_modules/lodash@4.0.0
└── b/
    └── node_modules/lodash@4.0.0

# After dedupe
node_modules/
├── a/
├── b/
└── lodash@4.0.0
copy

INSTALL

sudo pacman -S npm
copy
sudo apk add npm
copy
brew install npm
copy

CAVEATS

May not reduce size if version ranges differ. Run after npm install. Restructures tree only.

HISTORY

npm dedupe was introduced to help manage the duplicate dependency problem common in npm's nested node_modules structure.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid