nmgc
v3.2.1
Published
Remove the node_module and reinstall your npm packages in an easy way
Maintainers
Readme
Node Modules Garbage Cleaner
This module allows you to remove lock files (package-lock.json, yarn.lock, pnpm-lock.yaml) and node_modules from your project. It also provides a clean installation of your dependencies using npm, yarn, or pnpm.
Compatibility
The minimum supported version of Node.js is v6.
Usage
Installation
npm i -g nmgcOr use with npx
npx nmgc <COMMAND> [OPTIONS]Commands
USAGE:
nmgc <COMMAND> [OPTIONS]
COMMAND
h, help show general help
r, remove remove lock files (package-lock.json, yarn.lock, pnpm-lock.yaml) and node_modules
i, install clean dependencies and install them from package.json
OPTIONS:
-f, --force force the installation
--npm use npm package manager
--yarn use yarn package manager
--pnpm use pnpm package manager
NOTE: If no package manager is specified, it will auto-detect based on lock files.Examples
# Remove lock files and node_modules
$ nmgc remove
# Clean install with auto-detection
$ nmgc install
# Clean install using yarn
$ nmgc install --yarn
# Clean install using pnpm
$ nmgc install --pnpm
# Install a specific package with npm
$ nmgc install express
# Install a specific package with yarn
$ nmgc install lodash --yarn